From ba01aab0cffe3c2294ad696f0c5f625caf8ae753 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Tue, 8 Jul 2014 11:48:02 +0930 Subject: [PATCH] added some integration tests --- .../Clients/UserKeysClientTests.cs | 44 +++++++++++++++++++ .../Octokit.Tests.Integration.csproj | 1 + 2 files changed, 45 insertions(+) create mode 100644 Octokit.Tests.Integration/Clients/UserKeysClientTests.cs diff --git a/Octokit.Tests.Integration/Clients/UserKeysClientTests.cs b/Octokit.Tests.Integration/Clients/UserKeysClientTests.cs new file mode 100644 index 00000000..8d61050e --- /dev/null +++ b/Octokit.Tests.Integration/Clients/UserKeysClientTests.cs @@ -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); + } + } +} diff --git a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj index 97d9eff0..6ab0b6e6 100644 --- a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj +++ b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj @@ -78,6 +78,7 @@ +