public void AccountNumber_Is_One_Digit_Generates_Error() { // Arrange var validator = new AchValidator(); var account = new Ach { AccountNumber = "1" }; // Act var result = validator.Validate(account); // Assert Assert.True(result.Errors.Any(e => e.ErrorMessage == "AccountNumber must be numeric string and must be between 4 and 100 digits")); }
public void RoutingNumber_Has_9_Digits_Is_Valid() { // Arrange var validator = new AchValidator(); var account = new Ach { RoutingNumber = "123456789" }; // Act var result = validator.Validate(account); // Assert Assert.False(result.Errors.Any(e => e.ErrorMessage == "RoutingNumber must be a 9 digit number")); }
public void RoutingNumber_Has_Alpha_Generates_Error() { // Arrange var validator = new AchValidator(); var account = new Ach { RoutingNumber = "12345678A" }; // Act var result = validator.Validate(account); // Assert Assert.True(result.Errors.Any(e => e.ErrorMessage == "RoutingNumber must be a 9 digit number")); }
public void BankName_Is_100_Characters_Is_Valid() { // Arrange var validator = new AchValidator(); var account = new Ach { BankName = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" }; // Act var result = validator.Validate(account); // Assert Assert.False(result.Errors.Any(e => e.ErrorMessage == "BankName cannot exceed 100 characters")); }
public void BankName_Is_Empty_Generates_Error() { // Arrange var validator = new AchValidator(); var account = new Ach { BankName = "" }; // Act var result = validator.Validate(account); // Assert Assert.True(result.Errors.Any(e => e.ErrorMessage == "BankName is required")); }
public void AccountNumber_Ninety_Four_Asterisk_Four_Numbers_Is_Valid() { // Arrange var validator = new AchValidator(); var account = new Ach { AccountNumber = "************************************************************************************************1111" }; // Act var result = validator.Validate(account); // Assert Assert.False(result.Errors.Any(e => e.ErrorMessage == "AccountNumber must be numeric string and must be between 4 and 100 digits")); }