mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-24 23:25:52 +00:00
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using Octokit.Helpers;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Xunit;
|
|
|
|
namespace Octokit.Tests.Integration.Helpers
|
|
{
|
|
public class ReferenceExtensionsTests
|
|
{
|
|
[IntegrationTest]
|
|
public async Task CreateABranch()
|
|
{
|
|
var client = Helper.GetAuthenticatedClient();
|
|
var fixture = client.Git.Reference;
|
|
|
|
using (var context = await client.CreateRepositoryContext("public-repo"))
|
|
{
|
|
var branchFromMaster = await fixture.CreateBranch(context.RepositoryOwner, context.RepositoryName, "patch-1");
|
|
|
|
var branchFromPath = await fixture.CreateBranch(context.RepositoryOwner, context.RepositoryName, "patch-2", branchFromMaster);
|
|
|
|
var allBranchNames = (await client.Repository.GetAllBranches(context.RepositoryOwner, context.RepositoryName)).Select(b => b.Name);
|
|
|
|
Assert.Contains("patch-1", allBranchNames);
|
|
Assert.Contains("patch-2", allBranchNames);
|
|
}
|
|
}
|
|
}
|
|
}
|