mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 20:30:41 +00:00
Merge pull request #37 from octokit/haacked/OctokitRT-unit-tests
Haacked/octokit rt unit tests
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Octokit.Http;
|
||||
using Xunit;
|
||||
using Xunit.Extensions;
|
||||
@@ -30,8 +31,8 @@ namespace Octokit.Tests
|
||||
|
||||
var apiInfo = response.ApiInfo;
|
||||
Assert.NotNull(apiInfo);
|
||||
Assert.Equal(new[] { "user" }, apiInfo.AcceptedOauthScopes);
|
||||
Assert.Equal(new[] { "user", "public_repo", "repo", "gist" }, apiInfo.OauthScopes);
|
||||
Assert.Equal(new[] { "user" }, apiInfo.AcceptedOauthScopes.ToArray());
|
||||
Assert.Equal(new[] { "user", "public_repo", "repo", "gist" }, apiInfo.OauthScopes.ToArray());
|
||||
Assert.Equal(5000, apiInfo.RateLimit);
|
||||
Assert.Equal(4997, apiInfo.RateLimitRemaining);
|
||||
Assert.Equal("5634b0b187fd2e91e3126a75006cc4fa", apiInfo.Etag);
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{3F4686DA-8774-4940-823E-9138F4B42060}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Octokit.Tests</RootNamespace>
|
||||
<AssemblyName>Octokit.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="NSubstitute, Version=1.6.1.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\NSubstitute.1.6.1.0\lib\NET40\NSubstitute.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="xunit, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="xunit.extensions, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Authentication\CredentialsTests.cs" />
|
||||
<Compile Include="Clients\SshKeysClientTests.cs" />
|
||||
<Compile Include="Helpers\UriExtensionsTests.cs" />
|
||||
<Compile Include="Http\ApiConnectionTests.cs" />
|
||||
<Compile Include="Clients\AuthorizationsClientTests.cs" />
|
||||
<Compile Include="Clients\AutoCompleteClientTests.cs" />
|
||||
<Compile Include="Clients\OrganizationsClientTests.cs" />
|
||||
<Compile Include="Helpers\Arg.cs" />
|
||||
<Compile Include="Helpers\AssertEx.cs" />
|
||||
<Compile Include="Http\HttpClientAdapterTests.cs" />
|
||||
<Compile Include="Http\ApiInfoParserTests.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Authentication\BasicAuthenticatorTests.cs" />
|
||||
<Compile Include="Http\JsonHttpPipelineTests.cs" />
|
||||
<Compile Include="Fixtures\EmbeddedResource.cs" />
|
||||
<Compile Include="Fixtures\Fixtures.cs" />
|
||||
<Compile Include="GitHubClientTests.cs" />
|
||||
<Compile Include="Authentication\TokenAuthenticatorTests.cs" />
|
||||
<Compile Include="Http\ConnectionTests.cs" />
|
||||
<Compile Include="Http\ResponseTests.cs" />
|
||||
<Compile Include="Http\RequestTests.cs" />
|
||||
<Compile Include="Models\ModelExtensionsTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Helpers\StringExtensionsTests.cs" />
|
||||
<Compile Include="Clients\RepositoriesClientTests.cs" />
|
||||
<Compile Include="SimpleJsonSerializerTests.cs" />
|
||||
<Compile Include="Clients\UsersClientTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Fixtures\user_full.json" />
|
||||
<EmbeddedResource Include="Fixtures\authorizations.json" />
|
||||
<EmbeddedResource Include="Fixtures\authorization.json" />
|
||||
<EmbeddedResource Include="Fixtures\repository.json" />
|
||||
<EmbeddedResource Include="Fixtures\repositories.json" />
|
||||
<None Include="packages.config" />
|
||||
<EmbeddedResource Include="Fixtures\user.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Octokit\OctokitRT.csproj">
|
||||
<Project>{c8bc13b6-3fa3-4716-827d-e7706f976fe1}</Project>
|
||||
<Name>OctokitRT</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -17,6 +17,10 @@
|
||||
<xunit Assembly=".\Octokit.Tests\bin\$(Configuration)\Octokit.Tests.dll" Xml="Octokit.Tests.results.xml" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RunRTUnitTests" DependsOnTargets="Build">
|
||||
<xunit Assembly=".\OctokitRT.Tests\bin\$(Configuration)\OctokitRT.Tests.dll" Xml="OctokitRT.Tests.results.xml" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RunIntegrationTests" DependsOnTargets="Build; DoNotSkipIntegrationTests; SkipIntegrationTests" />
|
||||
|
||||
<Target Name="DoNotSkipIntegrationTests" DependsOnTargets="Build" Condition=" '$(OCTOKIT_GITHUBUSERNAME)'!='' And '$(OCTOKIT_GITHUBPASSWORD)'!='' " >
|
||||
|
||||
+12
@@ -28,6 +28,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OctokitRT", "Octokit\Octoki
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Octokit.Reactive", "Octokit.Reactive\Octokit.Reactive.csproj", "{674B69B8-0780-4D54-AE2B-C15821FA51CB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OctokitRT.Tests", "Octokit.Tests\OctokitRT.Tests.csproj", "{3F4686DA-8774-4940-823E-9138F4B42060}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -96,6 +98,16 @@ Global
|
||||
{674B69B8-0780-4D54-AE2B-C15821FA51CB}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{674B69B8-0780-4D54-AE2B-C15821FA51CB}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{674B69B8-0780-4D54-AE2B-C15821FA51CB}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{3F4686DA-8774-4940-823E-9138F4B42060}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3F4686DA-8774-4940-823E-9138F4B42060}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3F4686DA-8774-4940-823E-9138F4B42060}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{3F4686DA-8774-4940-823E-9138F4B42060}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{3F4686DA-8774-4940-823E-9138F4B42060}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{3F4686DA-8774-4940-823E-9138F4B42060}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3F4686DA-8774-4940-823E-9138F4B42060}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3F4686DA-8774-4940-823E-9138F4B42060}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{3F4686DA-8774-4940-823E-9138F4B42060}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{3F4686DA-8774-4940-823E-9138F4B42060}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -112,6 +112,17 @@ if ($result.ExitCode -eq 0) {
|
||||
}
|
||||
Write-Output ""
|
||||
|
||||
Write-Output "Running Octokit.Tests..."
|
||||
$result = Run-XUnit OctokitRT.Tests 120
|
||||
if ($result.ExitCode -eq 0) {
|
||||
# Print out the test result summary.
|
||||
Write-Output $result.Output[-1]
|
||||
} else {
|
||||
$exitCode = $result.ExitCode
|
||||
Write-Output $result.Output
|
||||
}
|
||||
Write-Output ""
|
||||
|
||||
Write-Output "Running Octokit.Tests.Integration..."
|
||||
$result = Run-XUnit Octokit.Tests.Integration 180
|
||||
if ($result.ExitCode -eq 0) {
|
||||
|
||||
Reference in New Issue
Block a user