コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
 public void AddindAValidAccountGeneratesAValidIBAN()
 {
     BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "06", "1234567890");
     BankAccount testAccount = new BankAccount(bankAccountFields);
     Assert.IsTrue(testAccount.HasValidIBAN);
 }
コード例 #6
0
        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;
            }
        }
コード例 #7
0
 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);
 }
コード例 #8
0
        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;
            }
        }
コード例 #9
0
 public void FormattedCCCOfANullCCCIsNull()
 {
     BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "05", "1234567890");
     BankAccount testAccount = new BankAccount(bankAccountFields);
     Assert.AreEqual(testAccount.CCC.FormattedCCC, null);
 }
コード例 #10
0
 public void FormattedIBANOfANullIBANIsNull()
 {
     BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "05", "1234567890");
     BankAccount testAccount = new BankAccount(bankAccountFields);
     Assert.AreEqual(testAccount.IBAN.FormattedIBAN, null);
 }
コード例 #11
0
 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");
 }
コード例 #12
0
 public void CountryCodeIBANPropertyIsCorrectlyDisplayed()
 {
     BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "06", "1234567890");
     BankAccount testAccount = new BankAccount(bankAccountFields);
     Assert.AreEqual("ES", testAccount.IBAN.InternationalCode);
 }
コード例 #13
0
        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;
            }
        }
コード例 #14
0
 public void AddingAnInvalidAccountDoesNotGenerateAValidIBAN()
 {
     BankAccountFields bankAccountFields = new BankAccountFields("1234", "5678", "05", "1234567890");
     BankAccount testAccount = new BankAccount(bankAccountFields);
     Assert.IsFalse(testAccount.HasValidIBAN);
 }
コード例 #15
0
 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);
     }
 }
コード例 #17
0
        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;
            }
        }