From 4e67f9dd8cbf74395955a88af995a70aaf1836a0 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Wed, 23 Dec 2015 13:50:53 +1030 Subject: [PATCH] a bit of cleanup --- .../Helpers/Audit/Section.cs | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/Octokit.Tests.Integration/Helpers/Audit/Section.cs b/Octokit.Tests.Integration/Helpers/Audit/Section.cs index 6fe1ab32..5ce5b47a 100644 --- a/Octokit.Tests.Integration/Helpers/Audit/Section.cs +++ b/Octokit.Tests.Integration/Helpers/Audit/Section.cs @@ -105,18 +105,26 @@ namespace Octokit.Tests.Integration List errors = new List(); + // starting at the `IGitHubClient` interface + // we'll look for properties which match with + // the route for this page + // + // for example: + // + // /activity/events/ + // + // 1. find a property named Activity on IGitHubClient + // 2. find a property named Events on IActivitiesClient + // + // this code will report back as soon as it isn't able + // to resolve a property, and it will use the original + // route value, not a translated value + // foreach (var property in properties) { - string lookup; - - if (pluralToSingleMap.ContainsKey(property)) - { - lookup = pluralToSingleMap[property]; - } - else - { - lookup = property; - } + string lookup = pluralToSingleMap.ContainsKey(property) + ? pluralToSingleMap[property] + : property; var found = currentType.GetProperties() .FirstOrDefault(p => p.Name.Equals(lookup, StringComparison.OrdinalIgnoreCase)); @@ -133,7 +141,11 @@ namespace Octokit.Tests.Integration currentType = found.PropertyType; } - // TODO: validate methods are documented + if (!errors.Any()) + { + // TODO: validate methods implement each + // of the documented endpoints + } return errors; }