mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 19:11:30 +00:00
fixed these broken old tests
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
using Xunit.Extensions;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Octokit.Tests.Conventions
|
||||
{
|
||||
@@ -16,7 +17,7 @@ namespace Octokit.Tests.Conventions
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(typeof(ClientInterfaces))]
|
||||
[MemberData("GetClientInterfaces")]
|
||||
public void CheckModelsForDebuggerDisplayAttribute(Type clientInterface)
|
||||
{
|
||||
var methods = clientInterface.GetMethods();
|
||||
@@ -34,5 +35,10 @@ namespace Octokit.Tests.Conventions
|
||||
AssertEx.HasAttribute<DebuggerDisplayAttribute>(modelType);
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<object[]> GetClientInterfaces()
|
||||
{
|
||||
return typeof(IEventsClient).Assembly.ExportedTypes.Where(TypeExtensions.IsClientInterface).Select(type => new[] { type });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace Octokit.Tests.Conventions
|
||||
public class SyncObservableClients
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(typeof(ClientInterfaces))]
|
||||
[MemberData("GetClientInterfaces")]
|
||||
public void CheckObservableClients(Type clientInterface)
|
||||
{
|
||||
var observableClient = clientInterface.GetObservableClientInterface();
|
||||
@@ -119,25 +119,10 @@ namespace Octokit.Tests.Conventions
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ClientInterfaces : IEnumerable<object[]>
|
||||
{
|
||||
private readonly IEnumerable<object[]> data = GetClientInterfaces();
|
||||
|
||||
public static IEnumerable<object[]> GetClientInterfaces()
|
||||
{
|
||||
return typeof(IEventsClient).Assembly.ExportedTypes.Where(TypeExtensions.IsClientInterface).Select(type => new[] { type });
|
||||
}
|
||||
|
||||
public IEnumerator<object[]> GetEnumerator()
|
||||
{
|
||||
return data.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user