public async Task Reconcile()
        {
            //Arrange
            var client = new VstsRestClient(_config.Organization, _config.Token);

            //Act
            var rule = new PipelineHasRequiredRetentionPolicy(client) as IReconcile;
            await rule.ReconcileAsync(_config.Project, PipelineId);
        }
Пример #2
0
        public async Task GivenPolicySettingsAreNotCorrect_WhenReconcile_ThenSettingsArePut()
        {
            //Arrange
            CustomizePolicySettings(_fixture, 10, false);
            SetupClient(_client, _fixture);

            //Act
            var rule = new PipelineHasRequiredRetentionPolicy(_client) as IReconcile;
            await rule.ReconcileAsync("", PipelineId);

            // Assert
            await _client
            .Received()
            .PutAsync(Arg.Any <IVstsRequest <ReleaseSettings> >(), Arg.Any <ReleaseSettings>());
        }
Пример #3
0
        public async Task GivenPolicySettingsAreCorrect_WhenReconcile_ThenPipelineIsUpdatedAnyway()
        {
            //Arrange
            CustomizePolicySettings(_fixture);
            SetupClient(_client, _fixture);

            //Act
            var rule = new PipelineHasRequiredRetentionPolicy(_client) as IReconcile;
            await rule.ReconcileAsync("", PipelineId);

            // Assert
            await _client
            .Received()
            .PutAsync(Arg.Any <IVstsRequest <object> >(), Arg.Any <JObject>());
        }