mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
using Xunit.Sdk;
|
|
|
|
namespace Octokit.Tests.Integration
|
|
{
|
|
public class OrganizationTestDiscoverer : IXunitTestCaseDiscoverer
|
|
{
|
|
readonly IMessageSink diagnosticMessageSink;
|
|
|
|
public OrganizationTestDiscoverer(IMessageSink diagnosticMessageSink)
|
|
{
|
|
this.diagnosticMessageSink = diagnosticMessageSink;
|
|
}
|
|
|
|
public IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute)
|
|
{
|
|
if (Helper.Organization == null)
|
|
{
|
|
return Enumerable.Empty<IXunitTestCase>();
|
|
}
|
|
|
|
return new[] { new XunitTestCase(diagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), testMethod) };
|
|
}
|
|
}
|
|
|
|
[XunitTestCaseDiscoverer("Octokit.Tests.Integration.OrganizationTestDiscoverer", "Octokit.Tests.Integration")]
|
|
public class OrganizationTestAttribute : FactAttribute
|
|
{
|
|
}
|
|
}
|