mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-04 03:16:11 +00:00
Tweak naming of classes to be consistent
Change team and user lists to specific classes derived from Collection<T> so we can offer better configuration of BranchProtectionPushRestriction via multiple ctors (teams only, users only, teams and users, etc) Add another ctor to BranchProtectionPushRestrictions for the case where no teams/users are specified (ie admin only) Change organization update tests to use this new ctor and assert we get empty lists rather than no push restrictions
This commit is contained in:
@@ -55,10 +55,10 @@ namespace Octokit.Tests.Integration.Helpers
|
||||
new RepositoryPermissionRequest(Permission.Push));
|
||||
|
||||
// Protect master branch
|
||||
var orgUpdate = new BranchProtectionSettingsUpdate(
|
||||
var protection = new BranchProtectionSettingsUpdate(
|
||||
new BranchProtectionRequiredStatusChecksUpdate(true, true, new[] { "build", "test" }),
|
||||
new ProtectedBranchRestrictionsUpdate(new[] { contextOrgTeam.TeamName }, new string[0]));
|
||||
await client.Repository.Branch.UpdateBranchProtection(contextOrgRepo.RepositoryOwner, contextOrgRepo.RepositoryName, "master", orgUpdate);
|
||||
new BranchProtectionPushRestrictionsUpdate(new BranchProtectionTeamCollection { contextOrgTeam.TeamName }));
|
||||
await client.Repository.Branch.UpdateBranchProtection(contextOrgRepo.RepositoryOwner, contextOrgRepo.RepositoryName, "master", protection);
|
||||
|
||||
return new OrganizationRepositoryWithTeamContext
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user