public void GetCheck2_Expected_InvalidCountryException(string iban) { var bban = GetBbanFromIBan(iban); Action action1 = () => BbanSplitterValidValidation.GetCheck2(null, bban); TestUtil.ExpectedException <InvalidCountryException>(action1); Action action2 = () => BbanSplitterInvalidValidation.GetCheck2(null, bban); TestUtil.ExpectedException <InvalidCountryException>(action2); }
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); } }
public void GetCheck2_It_Is_Not_Possible_To_Extract_The_Field_Expected_InvalidIbanException(string iban) { var country = new Mock <ICountry>(); country .Setup(x => x.Check2Position) .Returns(5); country .Setup(x => x.Check2Length) .Returns(5); Action action = () => BbanSplitterValidValidation.GetCheck2( country.Object, iban); TestUtil.ExpectedException <BbanSplitterException>(action); }