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:
Ryan Gribble
2016-08-25 07:38:24 +10:00
parent 46dc145e72
commit 902a5d765f
4 changed files with 102 additions and 24 deletions
@@ -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
{