mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 03:55:55 +00:00
added some integration tests
This commit is contained in:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user