mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 20:13:40 +00:00
[WIP] add integration test for add or update team repositories
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using Octokit;
|
||||
using Octokit.Tests.Integration;
|
||||
using Octokit.Tests.Integration.Helpers;
|
||||
using Xunit;
|
||||
|
||||
public class TeamsClientTests
|
||||
@@ -119,4 +120,28 @@ public class TeamsClientTests
|
||||
Assert.Contains(Helper.UserName, members.Select(u => u.Login));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheAddOrUpdateTeamRepositoryMethod
|
||||
{
|
||||
readonly Team team;
|
||||
|
||||
[OrganizationTest]
|
||||
public async Task CanAddRepository()
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
var repoName = Helper.MakeNameWithTimestamp("public-repo");
|
||||
|
||||
var team = github.Organization.Team.GetAll(Helper.Organization).Result.First();
|
||||
|
||||
using (var context = await github.CreateRepositoryContext(new NewRepository(repoName)))
|
||||
{
|
||||
var createdRepository = context.Repository;
|
||||
|
||||
var addRepo = await github.Organization.Team.AddRepository(team.Id, team.Organization.Name, createdRepository.Name, new RepositoryPermissionRequest(Permission.Admin));
|
||||
|
||||
Assert.NotNull(addRepo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user