public static void Create1(string value, string bban) { var parts = IbanParts.Parse(value).Value; var result = IbanParts.Create("FR", "34", bban); Assert.Equal(parts, result); }
public static Iban Create(string countryCode, string checkDigits, string bban, IbanValidationLevels levels) { var parts = IbanParts.Create(countryCode, checkDigits, bban); IbanValidator.TryValidate(parts, levels) .OnError(err => { throw new ArgumentException(err); }); return(new Iban(parts, levels)); }
public static void Create2(string value) => Assert.DoesNotThrow(() => IbanParts.Create("FR", "14", value));
public static void Create0d(string value) => Assert.Throws <ArgumentException>("bban", () => IbanParts.Create("FR", "14", value));
public static void Create0c(string value) => Assert.Throws <ArgumentException>("checkDigits", () => IbanParts.Create("FR", value, "20041010050500013M02606"));
public static void Create0b(string value) => Assert.Throws <ArgumentException>("countryCode", () => IbanParts.Create(value, "14", "20041010050500013M02606"));
public static void Create0a() { Assert.Throws <ArgumentNullException>("countryCode", () => IbanParts.Create(null, "14", "20041010050500013M02606")); Assert.Throws <ArgumentNullException>("checkDigits", () => IbanParts.Create("FR", null, "20041010050500013M02606")); Assert.Throws <ArgumentNullException>("bban", () => IbanParts.Create("FR", "14", null)); }