mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 06:05:12 +00:00
define tests which require basic authentication
This commit is contained in:
@@ -0,0 +1,33 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Xunit;
|
||||||
|
using Xunit.Abstractions;
|
||||||
|
using Xunit.Sdk;
|
||||||
|
|
||||||
|
namespace Octokit.Tests.Integration
|
||||||
|
{
|
||||||
|
public class BasicAuthenticationTestDiscoverer : IXunitTestCaseDiscoverer
|
||||||
|
{
|
||||||
|
readonly IMessageSink diagnosticMessageSink;
|
||||||
|
|
||||||
|
public BasicAuthenticationTestDiscoverer(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.BasicAuthenticationTestDiscoverer", "Octokit.Tests.Integration")]
|
||||||
|
public class BasicAuthenticationTestAttribute : FactAttribute
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -105,6 +105,7 @@
|
|||||||
<Compile Include="fixtures\RepositoriesHooksFixture.cs" />
|
<Compile Include="fixtures\RepositoriesHooksFixture.cs" />
|
||||||
<Compile Include="Helpers\ApplicationTestAttribute.cs" />
|
<Compile Include="Helpers\ApplicationTestAttribute.cs" />
|
||||||
<Compile Include="Helpers\GithubClientExtensions.cs" />
|
<Compile Include="Helpers\GithubClientExtensions.cs" />
|
||||||
|
<Compile Include="Helpers\BasicAuthenticationTestAttribute.cs" />
|
||||||
<Compile Include="Helpers\PersonalAccessTokenTestAttribute.cs" />
|
<Compile Include="Helpers\PersonalAccessTokenTestAttribute.cs" />
|
||||||
<Compile Include="Helpers\PaidAccountTestAttribute.cs" />
|
<Compile Include="Helpers\PaidAccountTestAttribute.cs" />
|
||||||
<Compile Include="Helpers\RepositoryContext.cs" />
|
<Compile Include="Helpers\RepositoryContext.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user