Esempio n. 1
0
 public void Should_Create_Account_Number_Objects_For_Every_Country()
 {
     foreach (var val in Enum.GetValues(typeof(Country)))
     {
         var result = IBANTools.CreateCountrySpecificAccountNumber((Country)val);
         Assert.IsNotNull(result);
     }
 }
Esempio n. 2
0
        public void Should_Convert_A_National_Account_Number_To_An_IBAN(string expectedIBAN, Country country, params string[] parts)
        {
            var sut = SuT;

            var result = sut.ToIBAN(IBANTools.CreateCountrySpecificAccountNumber(country, parts));

            Assert.AreEqual(expectedIBAN, result);
        }
Esempio n. 3
0
        private void cmbCountryValidation_SelectedIndexChanged(object sender, EventArgs e)
        {
            var country = (Country)cmbCountryValidation.SelectedItem;

            try
            {
                propertyGridNationalAccountNumberValidation.SelectedObject = IBANTools.CreateCountrySpecificAccountNumber(country);
            }
            catch (ArgumentException exc)
            {
                MessageBox.Show(this, exc.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 4
0
 public void Should_Create_Correct_Country_Specific_Account_Number_Objects()
 {
     foreach (var val in Enum.GetValues(typeof(Country)))
     {
         try
         {
             var result = IBANTools.CreateCountrySpecificAccountNumber((Country)val);
             Assert.AreEqual(val, result.Country);
         }
         catch (ArgumentException)
         {
             // unsupported countries doesn't matter here
         }
     }
 }