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

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

            TestUtil.ExpectedException <InvalidCountryException>(action1);

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

            TestUtil.ExpectedException <InvalidCountryException>(action2);
        }
Ejemplo n.º 2
0
        private void GetCheck3_Valid_Input_Return_Correct_Value(
            ICountry country, string bban, string check3)
        {
            var valueGot = BbanSplitterValidValidation.GetCheck3(country, bban);

            Assert.AreEqual(check3, valueGot);

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

            country
            .Setup(x => x.Check3Position)
            .Returns(5);
            country
            .Setup(x => x.Check3Length)
            .Returns(5);

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

            TestUtil.ExpectedException <BbanSplitterException>(action);
        }