Omit the IStatisticsClient from these convention tests

It doesn't follow the pattern of most of our other clients.
This commit is contained in:
Haacked
2015-08-07 16:37:54 -07:00
parent 375f83e031
commit 4e09d71a73
2 changed files with 16 additions and 7 deletions
+8 -2
View File
@@ -71,7 +71,8 @@ namespace Octokit.Tests.Conventions
.Where(x => x.Name.StartsWith("Get"));
var invalidMethods = methodsThatCanPaginate
.Where(x => !x.Name.StartsWith("GetAll"));
.Where(x => !x.Name.StartsWith("GetAll"))
.ToList();
if (invalidMethods.Any())
{
@@ -81,7 +82,12 @@ namespace Octokit.Tests.Conventions
public static IEnumerable<object[]> GetClientInterfaces()
{
return typeof(IEventsClient).Assembly.ExportedTypes.Where(TypeExtensions.IsClientInterface).Select(type => new[] { type });
return typeof(IEventsClient)
.Assembly
.ExportedTypes
.Where(TypeExtensions.IsClientInterface)
.Where(t => t != typeof(IStatisticsClient)) // This convention doesn't apply to this one type.
.Select(type => new[] { type });
}
public static IEnumerable<object[]> ModelTypes
@@ -1,12 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reactive;
using System.Reflection;
using Octokit.Tests.Helpers;
using Xunit;
using Xunit.Extensions;
namespace Octokit.Tests.Conventions
{
@@ -22,13 +20,13 @@ namespace Octokit.Tests.Conventions
var mainNames = Array.ConvertAll(mainMethods, m => m.Name);
var observableNames = Array.ConvertAll(observableMethods, m => m.Name);
var methodsMissingOnReactiveClient = mainNames.Except(observableNames);
var methodsMissingOnReactiveClient = mainNames.Except(observableNames).ToList();
if (methodsMissingOnReactiveClient.Any())
{
throw new InterfaceMissingMethodsException(observableClient, methodsMissingOnReactiveClient);
}
var additionalMethodsOnReactiveClient = observableNames.Except(mainNames);
var additionalMethodsOnReactiveClient = observableNames.Except(mainNames).ToList();
if (additionalMethodsOnReactiveClient.Any())
{
throw new InterfaceHasAdditionalMethodsException(observableClient, additionalMethodsOnReactiveClient);
@@ -122,7 +120,12 @@ namespace Octokit.Tests.Conventions
public static IEnumerable<object[]> GetClientInterfaces()
{
return typeof(IEventsClient).Assembly.ExportedTypes.Where(TypeExtensions.IsClientInterface).Select(type => new[] { type });
return typeof(IEventsClient)
.Assembly
.ExportedTypes
.Where(TypeExtensions.IsClientInterface)
.Where(t => t != typeof(IStatisticsClient)) // This convention doesn't apply to this one type.
.Select(type => new[] { type });
}
}
}