mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 20:30:41 +00:00
Merge pull request #309 from lbargaoanu/branches-integration-test
Integration test for get branches.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user