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

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

            TestUtil.ExpectedException <InvalidCountryException>(action1);

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

            TestUtil.ExpectedException <InvalidCountryException>(action2);
        }
Exemple #2
0
        private void GetCheck1_Valid_Input_Return_Correct_Value(
            ICountry country, string bban, string check1)
        {
            var valueGot = BbanSplitterValidValidation.GetCheck1(country, bban);

            Assert.AreEqual(check1, valueGot);

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

            country
            .Setup(x => x.Check1Position)
            .Returns(5);
            country
            .Setup(x => x.Check1Length)
            .Returns(5);

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

            TestUtil.ExpectedException <BbanSplitterException>(action);
        }