public void GivenBankAccountValidator_WhenValidateInvalidBankAccountNumber_ThrowsException() { var bankAccountNumber = "12345678901234567890123456789012345"; var validator = new BankAccountValidator(bankAccountNumber); Assert.Throws <InvalidBankAccountException>(() => validator.Validate()); }
public Customer StoreCustomer(Customer customer) { var bankAccountValidator = new BankAccountValidator(customer.BankAccountNumber); bankAccountValidator.Validate(); var storedCustomer = StoreCustomerImplementation(customer); return(storedCustomer); }