public void GetBranchCode_Expected_InvalidCountryException(string iban)
        {
            var bban = GetBbanFromIBan(iban);

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

            TestUtil.ExpectedException <InvalidCountryException>(action1);

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

            TestUtil.ExpectedException <InvalidCountryException>(action2);
        }
Exemple #2
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 GetBranchCode_It_Is_Not_Possible_To_Extract_The_Field_Expected_InvalidIbanException(string iban)
        {
            var country = new Mock <ICountry>();

            country
            .Setup(x => x.BranchCodePosition)
            .Returns(5);
            country
            .Setup(x => x.BranchCodeLength)
            .Returns(5);

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

            TestUtil.ExpectedException <BbanSplitterException>(action);
        }