public void BicValidationWithMoreCharactersShouldThrowException() { try { BicUtils.ValidateBIC("DEUTFFDEUTFF"); } catch (BicFormatException bex) { Assert.AreEqual(BicFormatViolation.BIC_LENGTH_8_OR_11, bex.FormatViolation); } }
public void BicValidationWithInvalidCountryCodeShouldThrowException() { try { BicUtils.ValidateBIC("DEUT_1FF"); } catch (BicFormatException bex) { Assert.AreEqual(BicFormatViolation.COUNTRY_CODE_ONLY_UPPER_CASE_LETTERS, bex.FormatViolation); } }
public void BicValidationWithInvalidBranchCodeShouldThrowException() { try { BicUtils.ValidateBIC("DEUTDEFF50_"); } catch (BicFormatException bex) { Assert.AreEqual(BicFormatViolation.BRANCH_CODE_ONLY_LETTERS_OR_DIGITS, bex.FormatViolation); } }
public void BicValidationWithInvalidBankCodeShouldThrowException() { try { BicUtils.ValidateBIC("DEU1DEFF"); } catch (BicFormatException bex) { Assert.AreEqual(BicFormatViolation.BANK_CODE_ONLY_LETTERS, bex.FormatViolation); } }
public void BicValidationWithLowercaseCharactersShouldThrowException() { try { BicUtils.ValidateBIC("DEUTdeFF"); } catch (BicFormatException bex) { Assert.AreEqual(BicFormatViolation.BIC_ONLY_UPPER_CASE_LETTERS, bex.FormatViolation); } }
public void BicValidationWithInvalidLocationCodeShouldThrowException() { try { BicUtils.ValidateBIC("DEUTDEF "); } catch (BicFormatException bex) { Assert.AreEqual((object)BicFormatViolation.LOCATION_CODE_ONLY_LETTERS_OR_DIGITS, bex.FormatViolation); } }
public void BicValidationWithEmptyShouldReturnThrowException() { BicUtils.ValidateBIC(""); }
public void BicValidationWithValidBicShouldNotThrowException() { BicUtils.ValidateBIC("DEUTDEFF500"); }
public void BicValidationWithNonExistingCountryCodeShouldThrowException() { BicUtils.ValidateBIC("DEUTXXFF"); }
/// <summary> /// BIC object creation /// </summary> /// <param name="bicCode">The string to be parsed as BIC code.</param> /// <returns>BIC object holding the value represented by the string argument.</returns> /// <exception cref="BicFormatException">If the string contains invalid BIC code<./exception> /// <exception cref="UnsupportedCountryException">If BIC's country is not supported.</exception> public static Bic CreateInstance(string bicCode) { BicUtils.ValidateBIC(bicCode); return(new Bic(bicCode)); }