public async Task GivenExistingPolicyPresent_WhenReconcile_PutIsUsed()
        {
            // Arrange
            CustomizeScope(_fixture);
            SetupPoliciesResolver(_policiesResolver, _fixture);

            // Act
            var rule = new ReleaseBranchesProtectedByPolicies(_client, _policiesResolver) as IReconcile;
            await rule.ReconcileAsync("", RepositoryId);

            // Assert
            await _client
            .Received()
            .PutAsync(Arg.Any <IVstsRequest <Policy> >(), Arg.Any <MinimumNumberOfReviewersPolicy>());
        }
        public async Task PolicySettingsOnReconcile()
        {
            // Arrange
            CustomizeScope(_fixture);
            SetupPoliciesResolver(_policiesResolver, _fixture);

            // Act
            var rule = new ReleaseBranchesProtectedByPolicies(_client, _policiesResolver) as IReconcile;
            await rule.ReconcileAsync("", RepositoryId);

            // Assert
            await _client
            .Received()
            .PutAsync(Arg.Any <IVstsRequest <Policy, Policy> >(),
                      Arg.Is <MinimumNumberOfReviewersPolicy>(p => !p.IsDeleted && p.IsBlocking && p.IsEnabled));
        }
        public async Task GivenExistingPolicyHasApproverCount_WhenReconcile_NotUpdated()
        {
            // Arrange
            CustomizeScope(_fixture);
            CustomizePolicySettings(_fixture, 3);
            SetupPoliciesResolver(_policiesResolver, _fixture);

            // Act
            var rule = new ReleaseBranchesProtectedByPolicies(_client, _policiesResolver) as IReconcile;
            await rule.ReconcileAsync("", RepositoryId);

            // Assert
            await _client
            .Received()
            .PutAsync(Arg.Any <IVstsRequest <Policy> >(),
                      Arg.Is <MinimumNumberOfReviewersPolicy>(x => x.Settings.MinimumApproverCount == 3));
        }