public void Validate_RequiredListFieldIsNull_ExceptionThrown() { // Assign var model = new TestModelRequired { Prop1 = "test" }; // Act & Assert Assert.Throws <ModelValidationException>(() => _validator.Validate(model)); }
public void Validate_RequiredFieldsNormal_Ok() { // Assign var model = new TestModelRequired { Prop1 = "test", Prop2 = new List <string>() }; // Act & Assert _validator.Validate(model); }
public void Validate_UserTypeRequiredFieldIsNullOtherIsOk_ExceptionThrown() { // Assign var model = new TestModelRequired { Prop1 = "test", Prop2 = new List <string>() }; // Act & Assert Assert.Throws <ModelValidationException>(() => _validator.Validate(model)); }