Skip to content

Commit

Permalink
Merge pull request #309 from lbargaoanu/branches-integration-test
Browse files Browse the repository at this point in the history
Integration test for get branches.
  • Loading branch information
shiftkey committed Jan 16, 2014
2 parents 364db53 + 1de2ea5 commit d04710a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Octokit.Tests.Integration/Clients/BranchesClientTests.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
1 change: 1 addition & 0 deletions Octokit.Tests.Integration/Octokit.Tests.Integration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<ItemGroup>
<Compile Include="Clients\AssigneesClientTests.cs" />
<Compile Include="Clients\BlobClientTests.cs" />
<Compile Include="Clients\BranchesClientTests.cs" />
<Compile Include="Clients\CommitsClientTests.cs" />
<Compile Include="Clients\CommitStatusClientTests.cs" />
<Compile Include="Clients\EventsClientTests.cs" />
Expand Down

0 comments on commit d04710a

Please sign in to comment.