public void Validate_IsRequiredNoValue_ValidationFailed(string value) { // Arrange var property = new ValidatedProperty <string>(value).IsRequired(); // Act var result = property.Validate(); // Assert AssertFailed(ref result, property, Strings.ValueIsMandatory); }
public void Validate_IsDoubleNoValue_ValidationFailed() { // Arrange var property = new ValidatedProperty <string>().IsDouble(); // Act var result = property.Validate(); // Assert AssertFailed(ref result, property, Strings.ValueHasIncorrectFormat); }
public void Validate_EmptyRules_ValidationSuccess(string value) { // Arrange var property = new ValidatedProperty <string>(value); // Act var result = property.Validate(); // Assert AssertSuccess(ref result, property); }
public void Validate_TwoRules_ValidationFailed(string value, string expectedError) { // Arrange var property = new ValidatedProperty <string>(value) .IsRequired() .IsDouble(); // Act var result = property.Validate(); // Assert AssertFailed(ref result, property, expectedError); }