public void Can_activate_Avc_configuration() { var id = Guid.NewGuid(); Container.Resolve <BrandTestHelper>().CreateBrand(isActive: true); var avcConfiguration = new AVCConfigurationDTO { Id = id, Brand = _brandQueries.GetBrands().First().Id, }; _avcConfigurationCommands.Create(avcConfiguration); var latestAutoVerificationCheckCriteria = _avcConfigurationQueries .GetAutoVerificationCheckConfiguration(id); //The default state of criteria at the moment of creation must be Inactive Assert.AreEqual(AutoVerificationCheckStatus.Inactive, latestAutoVerificationCheckCriteria.Status); //We activate the newly created AVC var activationCommand = new AvcChangeStatusCommand() { Id = avcConfiguration.Id }; _avcConfigurationCommands.Activate(activationCommand); var latestAutoVerificationCheckCriteriaActivated = _avcConfigurationQueries .GetAutoVerificationCheckConfiguration(id); Assert.AreEqual(AutoVerificationCheckStatus.Active, latestAutoVerificationCheckCriteriaActivated.Status); }
public void Activate(Guid configurationId, string remarks = null) { _avcConfigurationCommands.Activate(new AvcChangeStatusCommand { Id = configurationId, Remarks = remarks }); }
public ActionResult Activate(AvcChangeStatusCommand model) { var validationResult = _avcConfigurationQueries .GetValidationResult(model, AutoVerificationCheckStatus.Inactive); if (validationResult.IsValid == false) { return(ValidationErrorResponse(validationResult)); } _avcConfigurationCommands.Activate(model); return(Json(new { Success = true })); }