the other tests no wpass

This commit is contained in:
Brendan Forster
2014-12-17 20:16:02 +09:30
parent 2b2fa1c5e3
commit 491e54d26e
7 changed files with 88 additions and 38 deletions
@@ -6,6 +6,7 @@ using Octokit.Tests.Helpers;
using Octokit.Tests.Integration;
using Xunit;
using System;
using Octokit.Tests.Integration.Clients;
public class TeamsClientTests
{
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace Octokit.Tests.Integration
{
public class IntegrationTestDiscoverer : IXunitTestCaseDiscoverer
{
public IEnumerable<IXunitTestCase> Discover(ITestMethod testMethod, IAttributeInfo factAttribute)
{
yield return new IntegrationTestCase(testMethod);
}
}
[XunitTestCaseDiscoverer("Octokit.Tests.Integration.IntegrationTestDiscoverer", "Octokit.Tests.Integration")]
public class IntegrationTestAttribute : FactAttribute
{
}
[Serializable]
public class IntegrationTestCase : XunitTestCase
{
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Called by the de-serializer", true)]
public IntegrationTestCase() { }
public IntegrationTestCase(ITestMethod testMethod)
: base(testMethod, testMethodArguments: null)
{
}
}
}
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace Octokit.Tests.Integration
{
public class OrganizationTestDiscoverer : IXunitTestCaseDiscoverer
{
public IEnumerable<IXunitTestCase> Discover(ITestMethod testMethod, IAttributeInfo factAttribute)
{
if (Helper.Organization == null)
{
return Enumerable.Empty<IXunitTestCase>();
}
else
{
return new[] { new OrganizationTestCase(testMethod) };
}
}
}
[XunitTestCaseDiscoverer("Octokit.Tests.Integration.OrganizationTestDiscoverer", "Octokit.Tests.Integration")]
public class OrganizationTestAttribute : FactAttribute
{
}
[Serializable]
public class OrganizationTestCase : XunitTestCase
{
public OrganizationTestCase(ITestMethod testMethod)
: base(testMethod, testMethodArguments: null)
{
}
}
}
@@ -1,17 +0,0 @@
using System.Collections.Generic;
using Xunit;
using Xunit.Sdk;
namespace Octokit.Tests.Integration
{
public class IntegrationTestAttribute : FactAttribute
{
protected override IEnumerable<ITestCommand> EnumerateTestCommands(IMethodInfo testMethod)
{
if (Helper.Credentials == null)
yield return new SkipCommand(testMethod, MethodUtility.GetDisplayName(testMethod), "Automation settings not configured. Please set the OCTOKIT_GITHUBUSERNAME and OCTOKIT_GITHUBPASSWORD environment variables to a GitHub test account (i.e, DO NOT USE A \"REAL\" ACCOUNT).");
else
yield return new FactCommand(testMethod);
}
}
}
@@ -61,6 +61,10 @@
<Reference Include="xunit.core">
<HintPath>..\packages\xunit.core.2.0.0-beta5-build2785\lib\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid\xunit.core.dll</HintPath>
</Reference>
<Reference Include="xunit.execution, Version=2.0.0.2785, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xunit.core.2.0.0-beta5-build2785\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid\xunit.execution.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Clients\AssigneesClientTests.cs" />
@@ -88,11 +92,11 @@
<Compile Include="Helpers\RepositorySetupHelper.cs" />
<Compile Include="HttpClientAdapterTests.cs" />
<Compile Include="Clients\TeamsClientTests.cs" />
<Compile Include="IntegrationTestAttribute.cs" />
<Compile Include="Helpers\IntegrationTestAttribute.cs" />
<Compile Include="Clients\PullRequestReviewCommentsClientTests.cs" />
<Compile Include="Clients\IssuesClientTests.cs" />
<Compile Include="Clients\MiscellaneousClientTests.cs" />
<Compile Include="OrganizationTestAttribute.cs" />
<Compile Include="Helpers\OrganizationTestAttribute.cs" />
<Compile Include="Reactive\ObservableIssuesClientTests.cs" />
<Compile Include="Reactive\ObservableMilestonesClientTests.cs" />
<Compile Include="Reactive\ObservableRepositoriesClientTests.cs" />
@@ -1,19 +0,0 @@
using System.Collections.Generic;
using Xunit.Sdk;
namespace Octokit.Tests.Integration
{
public class OrganizationTestAttribute : IntegrationTestAttribute
{
protected override IEnumerable<ITestCommand> EnumerateTestCommands(IMethodInfo testMethod)
{
if (Helper.Organization == null)
return new[]
{
new SkipCommand(testMethod, MethodUtility.GetDisplayName(testMethod), "Automation settings not configured. Please set the OCTOKIT_GITHUBORGANIZATION environment variable to a GitHub organization owned by the test account specified in OCTOKIT_GITHUBUSERNAME.")
};
else
return base.EnumerateTestCommands(testMethod);
}
}
}
@@ -11,6 +11,7 @@ using System;
using System.Collections.Generic;
using Xunit.Sdk;
using Octokit.Reactive;
using Octokit.Tests.Integration.Clients;
public class ObservableTeamsClientTests
{