From 1de2ea529e5c7a4d78039c77f69467bd87d4ec5a Mon Sep 17 00:00:00 2001 From: lbargaoanu Date: Thu, 16 Jan 2014 16:45:51 +0200 Subject: [PATCH] integration test for get branches --- .../Clients/BranchesClientTests.cs | 39 +++++++++++++++++++ .../Octokit.Tests.Integration.csproj | 1 + 2 files changed, 40 insertions(+) create mode 100644 Octokit.Tests.Integration/Clients/BranchesClientTests.cs diff --git a/Octokit.Tests.Integration/Clients/BranchesClientTests.cs b/Octokit.Tests.Integration/Clients/BranchesClientTests.cs new file mode 100644 index 00000000..c0ac66bc --- /dev/null +++ b/Octokit.Tests.Integration/Clients/BranchesClientTests.cs @@ -0,0 +1,39 @@ +using System; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using Octokit; +using Octokit.Tests.Integration; +using Xunit; + +public class BranchesClientTests +{ + public class TheGetBranchesMethod : IDisposable + { + readonly Repository _repository; + readonly GitHubClient _github; + + public TheGetBranchesMethod() + { + _github = new GitHubClient(new ProductHeaderValue("OctokitTests")) + { + Credentials = Helper.Credentials + }; + var repoName = Helper.MakeNameWithTimestamp("public-repo"); + _repository = _github.Repository.Create(new NewRepository { Name = repoName, AutoInit = true }).Result; + } + + [IntegrationTest] + public async Task ReturnsBranches() + { + var branches = await _github.Repository.GetAllBranches(_repository.Owner.Login, _repository.Name); + + Assert.NotEmpty(branches); + Assert.Equal(branches[0].Name, "master"); + } + + public void Dispose() + { + Helper.DeleteRepo(_repository); + } + } +} \ No newline at end of file diff --git a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj index fa8beaf1..cf1aa4aa 100644 --- a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj +++ b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj @@ -59,6 +59,7 @@ +