mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +00:00
31 lines
1.0 KiB
C#
31 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 IntegrationTestDiscoverer : IXunitTestCaseDiscoverer
|
|
{
|
|
readonly IMessageSink diagnosticMessageSink;
|
|
|
|
public IntegrationTestDiscoverer(IMessageSink diagnosticMessageSink)
|
|
{
|
|
this.diagnosticMessageSink = diagnosticMessageSink;
|
|
}
|
|
|
|
public IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute)
|
|
{
|
|
return Helper.Credentials == null
|
|
? Enumerable.Empty<IXunitTestCase>()
|
|
: new[] { new XunitTestCase(diagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), TestMethodDisplayOptions.None, testMethod) };
|
|
}
|
|
}
|
|
|
|
[XunitTestCaseDiscoverer("Octokit.Tests.Integration.IntegrationTestDiscoverer", "Octokit.Tests.Integration")]
|
|
public class IntegrationTestAttribute : FactAttribute
|
|
{
|
|
}
|
|
}
|