added some integration tests

This commit is contained in:
Brendan Forster
2014-07-08 11:48:02 +09:30
parent 605500b34f
commit ba01aab0cf
2 changed files with 45 additions and 0 deletions
@@ -0,0 +1,44 @@
using System.Threading.Tasks;
using Xunit;
namespace Octokit.Tests.Integration.Clients
{
public class UserKeysClientTests
{
[IntegrationTest]
public async Task GetAll()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
var keys = await github.User.Keys.GetAll();
Assert.NotEmpty(keys);
var first = keys[0];
Assert.NotNull(first.Id);
Assert.NotNull(first.Key);
Assert.NotNull(first.Title);
Assert.NotNull(first.Url);
}
[IntegrationTest]
public async Task GetAllForGivenUser()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
var keys = await github.User.Keys.GetAll("shiftkey");
Assert.NotEmpty(keys);
var first = keys[0];
Assert.NotNull(first.Id);
Assert.NotNull(first.Key);
Assert.Null(first.Title);
Assert.Null(first.Url);
}
}
}
@@ -78,6 +78,7 @@
<Compile Include="Clients\TreeClientTests.cs" />
<Compile Include="Clients\UserEmailsClientTests.cs" />
<Compile Include="Clients\FollowersClientTests.cs" />
<Compile Include="Clients\UserKeysClientTests.cs" />
<Compile Include="HttpClientAdapterTests.cs" />
<Compile Include="Clients\TeamsClientTests.cs" />
<Compile Include="IntegrationTestAttribute.cs" />