public void Validate_GivenDuplicateDatasetDefinitionName_ValidIsFalse() { //Arrange DatasetDefinition model = CreateModel(); model.Name = DatasetDefinitionName; model.Id = DatasetDefinitionId; DatasetDefinitionValidator validator = CreateValidator(); //Act ValidationResult result = validator.Validate(model); //Assert result .IsValid .Should() .BeFalse(); result .Errors .Count .Should() .Be(1); }
public void Validate_GivenDuplicateFieldDefinitionName_ValidIsFalse() { //Arrange DatasetDefinition model = CreateModel(); model.TableDefinitions = new List <TableDefinition> { new TableDefinition { FieldDefinitions = new List <FieldDefinition> { new FieldDefinition { Name = "my function name" }, new FieldDefinition { Name = "My Function Name" } } } }; DatasetDefinitionValidator validator = CreateValidator(); //Act ValidationResult result = validator.Validate(model); //Assert result .IsValid .Should() .BeFalse(); result .Errors .Count .Should() .Be(1); }
public void Validate_GivenInvalidFundingStreamId_ValidIsFalse() { //Arrange DatasetDefinition model = CreateModel(); model.FundingStreamId = "test-invalid-funding-stream-id"; DatasetDefinitionValidator validator = CreateValidator(); //Act ValidationResult result = validator.Validate(model); //Assert result .IsValid .Should() .BeFalse(); result .Errors .Count .Should() .Be(1); }