Example #1
0
 public void BicValidationWithMoreCharactersShouldThrowException()
 {
     try
     {
         BicUtils.ValidateBIC("DEUTFFDEUTFF");
     }
     catch (BicFormatException bex)
     {
         Assert.AreEqual(BicFormatViolation.BIC_LENGTH_8_OR_11, bex.FormatViolation);
     }
 }
Example #2
0
 public void BicValidationWithInvalidCountryCodeShouldThrowException()
 {
     try
     {
         BicUtils.ValidateBIC("DEUT_1FF");
     }
     catch (BicFormatException bex)
     {
         Assert.AreEqual(BicFormatViolation.COUNTRY_CODE_ONLY_UPPER_CASE_LETTERS, bex.FormatViolation);
     }
 }
Example #3
0
 public void BicValidationWithInvalidBranchCodeShouldThrowException()
 {
     try
     {
         BicUtils.ValidateBIC("DEUTDEFF50_");
     }
     catch (BicFormatException bex)
     {
         Assert.AreEqual(BicFormatViolation.BRANCH_CODE_ONLY_LETTERS_OR_DIGITS, bex.FormatViolation);
     }
 }
Example #4
0
 public void BicValidationWithInvalidBankCodeShouldThrowException()
 {
     try
     {
         BicUtils.ValidateBIC("DEU1DEFF");
     }
     catch (BicFormatException bex)
     {
         Assert.AreEqual(BicFormatViolation.BANK_CODE_ONLY_LETTERS, bex.FormatViolation);
     }
 }
Example #5
0
 public void BicValidationWithLowercaseCharactersShouldThrowException()
 {
     try
     {
         BicUtils.ValidateBIC("DEUTdeFF");
     }
     catch (BicFormatException bex)
     {
         Assert.AreEqual(BicFormatViolation.BIC_ONLY_UPPER_CASE_LETTERS, bex.FormatViolation);
     }
 }
Example #6
0
 public void BicValidationWithInvalidLocationCodeShouldThrowException()
 {
     try
     {
         BicUtils.ValidateBIC("DEUTDEF ");
     }
     catch (BicFormatException bex)
     {
         Assert.AreEqual((object)BicFormatViolation.LOCATION_CODE_ONLY_LETTERS_OR_DIGITS, bex.FormatViolation);
     }
 }
Example #7
0
 public void BicValidationWithEmptyShouldReturnThrowException()
 {
     BicUtils.ValidateBIC("");
 }
Example #8
0
 public void BicValidationWithValidBicShouldNotThrowException()
 {
     BicUtils.ValidateBIC("DEUTDEFF500");
 }
Example #9
0
 public void BicValidationWithNonExistingCountryCodeShouldThrowException()
 {
     BicUtils.ValidateBIC("DEUTXXFF");
 }
Example #10
0
 /// <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));
 }