add RequiredApprovingReview preview functionality to branch protection calls (#1912)

This commit is contained in:
Ryan Gribble
2019-01-30 21:20:50 +10:00
committed by GitHub
parent 64cecbb264
commit cf442499ff
9 changed files with 213 additions and 163 deletions
@@ -32,7 +32,7 @@ namespace Octokit.Tests.Integration.Helpers
// Protect master branch
var update = new BranchProtectionSettingsUpdate(
new BranchProtectionRequiredStatusChecksUpdate(true, new[] { "build", "test" }),
new BranchProtectionRequiredReviewsUpdate(true, true),
new BranchProtectionRequiredReviewsUpdate(true, true, 3),
null,
true);
@@ -60,7 +60,7 @@ namespace Octokit.Tests.Integration.Helpers
// Protect master branch
var protection = new BranchProtectionSettingsUpdate(
new BranchProtectionRequiredStatusChecksUpdate(true, new[] { "build", "test" }),
new BranchProtectionRequiredReviewsUpdate(new BranchProtectionRequiredReviewsDismissalRestrictionsUpdate(new BranchProtectionTeamCollection { contextOrgTeam.TeamName }), true, true),
new BranchProtectionRequiredReviewsUpdate(new BranchProtectionRequiredReviewsDismissalRestrictionsUpdate(new BranchProtectionTeamCollection { contextOrgTeam.TeamName }), true, true, 3),
new BranchProtectionPushRestrictionsUpdate(new BranchProtectionTeamCollection { contextOrgTeam.TeamName }),
true);
await client.Repository.Branch.UpdateBranchProtection(contextOrgRepo.RepositoryOwner, contextOrgRepo.RepositoryName, "master", protection);