Beispiel #1
0
        private void GetBankCode_Valid_Input_Return_Correct_Value(
            ICountry country, string bban, string bankCode)
        {
            var valueGot = BbanSplitterValidValidation.GetBankCode(country, bban);

            Assert.AreEqual(bankCode, valueGot);
        }
        private void GetaccountNumber_Valid_Input_Return_Correct_Value(
            ICountry country, string bban, string accountNumber)
        {
            var valueGot = BbanSplitterValidValidation.GetAccountNumber(country, bban);

            Assert.AreEqual(accountNumber, valueGot);
        }
        public void GetBankCode_Expected_InvalidCountryException(string iban)
        {
            var bban = GetBbanFromIBan(iban);

            Action action1 = () => BbanSplitterValidValidation.GetBankCode(null, bban);

            TestUtil.ExpectedException <InvalidCountryException>(action1);

            Action action2 = () => BbanSplitterInvalidValidation.GetBankCode(null, bban);

            TestUtil.ExpectedException <InvalidCountryException>(action2);
        }
Beispiel #4
0
        private void GetCheck2_Valid_Input_Return_Correct_Value(
            ICountry country, string bban, string check2)
        {
            var valueGot = BbanSplitterValidValidation.GetCheck2(country, bban);

            Assert.AreEqual(check2, valueGot);

            if (country.Check2Position.HasValue)
            {
                Assert.AreNotEqual(valueGot, null);
            }
            else
            {
                Assert.AreEqual(valueGot, null);
            }
        }
Beispiel #5
0
        private void GetbranchCode_Valid_Input_Return_Correct_Value(
            ICountry country, string bban, string branchCode)
        {
            var valueGot = BbanSplitterValidValidation.GetBranchCode(country, bban);

            Assert.AreEqual(branchCode, valueGot);

            if (country.BranchCodePosition.HasValue)
            {
                Assert.AreNotEqual(valueGot, null);
            }
            else
            {
                Assert.AreEqual(valueGot, null);
            }
        }
        public void GetAccountNumber_It_Is_Not_Possible_To_Extract_The_Field_Expected_InvalidIbanException(string iban)
        {
            var country = new Mock <ICountry>();

            country
            .Setup(x => x.AccountNumberPosition)
            .Returns(5);
            country
            .Setup(x => x.AccountNumberLength)
            .Returns(5);

            Action action = () => BbanSplitterValidValidation.GetAccountNumber(
                country.Object,
                iban);

            TestUtil.ExpectedException <BbanSplitterException>(action);
        }