public static IbanParts Build(string countryCode, string bban) { Require.NotNull(countryCode, nameof(countryCode)); Require.NotNull(bban, nameof(bban)); Require.True(CountryPart.Validate(countryCode), nameof(countryCode)); Require.True(BbanPart.Validate(bban), nameof(bban)); string checkDigits = IbanCheckDigits.Compute(countryCode, bban); return(new IbanParts(countryCode, checkDigits, bban)); }
public static void ComputeInt32Checksum0b(string value) { Assert.Throws <ArgumentOutOfRangeException>("value", () => IbanCheckDigits.ComputeInt32Checksum(value)); }
public static void ComputeInt32Checksum0a() { Assert.Throws <ArgumentNullException>("value", () => IbanCheckDigits.ComputeInt32Checksum(null)); }
public static void Verify6(string value) => Assert.False(IbanCheckDigits.Verify(value, true));
public static void Verify2(string value) => Assert.True(IbanCheckDigits.Verify(value, false));
public static void Compute3(string value) { var iban = IbanParts.Parse(value).Value; Assert.Equal(iban.CheckDigits, IbanCheckDigits.Compute(iban.CountryCode, iban.Bban, true)); }
public static void Compute0b(string value) { Assert.Throws <ArgumentOutOfRangeException>("countryCode", () => IbanCheckDigits.Compute(value, "bban", true)); }
public static void Compute0a() { Assert.Throws <ArgumentNullException>("bban", () => IbanCheckDigits.Compute("countryCode", null, true)); Assert.Throws <ArgumentNullException>("countryCode", () => IbanCheckDigits.Compute(null, "bban", true)); }
public static void ComputeInt64Checksum3(string value) => Assert.Throws <ArgumentException>(() => IbanCheckDigits.ComputeInt64Checksum(value));
public static void ComputeInt64Checksum2(string value) => Assert.NotEqual(1, IbanCheckDigits.ComputeInt64Checksum(value));
public static void ComputeInt32Checksum1(string value) => Assert.Equal(1, IbanCheckDigits.ComputeInt32Checksum(value));
public static bool VerifyIntegrity(IbanParts parts) => IbanCheckDigits.Verify(parts.LiteralValue);