public void AcceptsNullOnAcountNumbers() { BankAccountFields bankAccountFields = new BankAccountFields(null, "", "02", "aaaaa"); BankAccount testAccount = new BankAccount(bankAccountFields); Assert.IsFalse(testAccount.HasValidBankAccountFields); Assert.AreEqual(null, testAccount.BankAccountFieldCodes.BankCode); }
public void AcceptsEmptyAcountNumbers() { BankAccountFields bankAccountFields = new BankAccountFields("", "", "", ""); BankAccount testAccount = new BankAccount(bankAccountFields); string storedData = testAccount.BankAccountFieldCodes.BankCode + testAccount.BankAccountFieldCodes.OfficeCode + testAccount.BankAccountFieldCodes.CheckDigits + testAccount.BankAccountFieldCodes.AccountNumber; Assert.IsFalse(testAccount.HasValidBankAccountFields); Assert.AreEqual("", storedData); }
public void AcceptsInvalidAcountNumbers() { BankAccountFields bankAccountFields = new BankAccountFields("124", "1 00", " 4", "100/234-1"); BankAccount testAccount = new BankAccount(bankAccountFields); string givenData = "124" + "1 00" + " 4" + "100/234-1"; string storedData = testAccount.BankAccountFieldCodes.BankCode + testAccount.BankAccountFieldCodes.OfficeCode + testAccount.BankAccountFieldCodes.CheckDigits + testAccount.BankAccountFieldCodes.AccountNumber; Assert.IsFalse(testAccount.HasValidBankAccountFields); Assert.AreEqual(givenData, storedData); }
public void AccounNumberMaxLenghtIs10() { try { BankAccountFields bankAccountFields = new BankAccountFields(null, "", "02", "1234561234578909"); BankAccount testAccount = new BankAccount(bankAccountFields); } catch (System.ArgumentException e) { Assert.AreEqual("número de cuenta", e.ParamName); throw e; } }
public void AddindAValidAccountGeneratesAValidIBAN() { BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "06", "1234567890"); BankAccount testAccount = new BankAccount(bankAccountFields); Assert.IsTrue(testAccount.HasValidIBAN); }
public void OfficeCodeMaxLengthIs4() { try { BankAccountFields bankAccountFields = new BankAccountFields(null, "65466", "00", "12345678"); BankAccount testAccount = new BankAccount(bankAccountFields); } catch (System.ArgumentException e) { Assert.AreEqual("sucursal", e.ParamName); throw e; } }
public void NullParsedtoEmptyStringWhenConcatenated() { BankAccountFields bankAccountFields = new BankAccountFields(null, "01", null, "aaaaa"); BankAccount testAccount = new BankAccount(bankAccountFields); string storedData = testAccount.BankAccountFieldCodes.BankCode + testAccount.BankAccountFieldCodes.OfficeCode + testAccount.BankAccountFieldCodes.CheckDigits + testAccount.BankAccountFieldCodes.AccountNumber; Assert.IsFalse(testAccount.HasValidBankAccountFields); Assert.AreEqual("01aaaaa", storedData); }
public void IfManyArgumentExceptionsOnlyFirstIsThrown() { try { BankAccountFields bankAccountFields = new BankAccountFields("4234", "46565", "050", "12345678"); BankAccount testAccount = new BankAccount(bankAccountFields); } catch (System.ArgumentException e) { Assert.AreEqual("sucursal", e.ParamName); throw e; } }
public void FormattedCCCOfANullCCCIsNull() { BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "05", "1234567890"); BankAccount testAccount = new BankAccount(bankAccountFields); Assert.AreEqual(testAccount.CCC.FormattedCCC, null); }
public void FormattedIBANOfANullIBANIsNull() { BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "05", "1234567890"); BankAccount testAccount = new BankAccount(bankAccountFields); Assert.AreEqual(testAccount.IBAN.FormattedIBAN, null); }
public void CreatedIBANAreWellFormattedWithSpaces() { BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "06", "1234567890"); BankAccount testAccount = new BankAccount(bankAccountFields); Assert.AreEqual(testAccount.IBAN.FormattedIBAN, "IBAN ES68 1234 5678 0612 3456 7890"); }
public void CountryCodeIBANPropertyIsCorrectlyDisplayed() { BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "06", "1234567890"); BankAccount testAccount = new BankAccount(bankAccountFields); Assert.AreEqual("ES", testAccount.IBAN.InternationalCode); }
public void CheckDigitsMaxLegthIs2() { try { BankAccountFields bankAccountFields = new BankAccountFields(null, "", "020", "12345678"); BankAccount testAccount = new BankAccount(bankAccountFields); } catch (System.ArgumentException e) { Assert.AreEqual("dígito de control", e.ParamName); throw e; } }
public void AddingAnInvalidAccountDoesNotGenerateAValidIBAN() { BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "05", "1234567890"); BankAccount testAccount = new BankAccount(bankAccountFields); Assert.IsFalse(testAccount.HasValidIBAN); }
public void IBANCheckPropertyIsCorrectlyDisplayed() { BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "06", "1234567890"); BankAccount testAccount = new BankAccount(bankAccountFields); Assert.AreEqual("68", testAccount.IBAN.IBANCheck); }
public void WhenIProcessTheBankAccount() { BankAccount bankAccount; try { BankAccountFields bankAccountFields= new BankAccountFields( bankAccountContextData.bank, bankAccountContextData.office, bankAccountContextData.checkDigits, bankAccountContextData.accountNumber); bankAccount = new BankAccount(bankAccountFields); ScenarioContext.Current.Add("Bank_Account", bankAccount); } catch { ScenarioContext.Current.Add("Bank_Account", null); } }
public void BankCodeMaxLengthIs4() { try { BankAccountFields bankAccountFields = new BankAccountFields("04234", "466", "00", "12345678"); BankAccount testAccount = new BankAccount(bankAccountFields); } catch (System.ArgumentException e) { Assert.AreEqual("banco", e.ParamName); throw e; } }