public void Create_Get_Update_ValidationCondition_Succeeds() { // Arrange ValidationConditionEntity validationConditionEntity = new ValidationConditionEntity { ActiveFlag = true, ApplicationID = "Guardian", DateCreatedOffset = DateTimeOffset.UtcNow, DateModifiedOffset = DateTimeOffset.UtcNow, Expression = "1" }; // Act _dataProvider.CreateValidationCondition(validationConditionEntity); ValidationConditionEntity createdValidationConditionEntity = (ValidationConditionEntity)_dataProvider.GetValidationCondition(validationConditionEntity.ValidationConditionID); createdValidationConditionEntity.Expression = "2"; _dataProvider.UpdateValidationCondition(createdValidationConditionEntity); ValidationConditionEntity updatedValidationConditionEntity = (ValidationConditionEntity)_dataProvider.GetValidationCondition(createdValidationConditionEntity.ValidationConditionID); // Assert updatedValidationConditionEntity.Should().Be(createdValidationConditionEntity); }
public IResponse CreateValidationCondition(ValidationCondition validationCondition) { GuardianOptions options = GuardianOptionsFactory.GetOptions(); GuardianDataProvider dataProvider = options.GuardianDataProviderFactory(); IValidationCondition createdValidation = dataProvider.CreateValidationCondition(validationCondition); return(new JsonResponse(dataProvider.GetValidationCondition(createdValidation.ValidationConditionID))); }