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 void Parse5(string value, string bban) { var parts = IbanParts.Parse(value).Value; Assert.Equal("FR", parts.CountryCode); Assert.Equal("34", parts.CheckDigits); Assert.Equal(bban, parts.Bban); }
public static void Build1(string value) { // NB: We must use actual IBANs since Build() will compute the checksum. var parts = IbanParts.Parse(value).Value; var result = IbanParts.Build(parts.CountryCode, parts.Bban); Assert.Equal(parts, result); }
public static Iban?Parse(string value, IbanStyles styles, IbanValidationLevels levels) { if (value == null) { return(null); } var val = PreprocessInput(value, styles); var parts = IbanParts.Parse(val); if (!parts.HasValue) { return(null); } if (!IbanValidator.Validate(parts.Value, levels)) { return(null); } return(new Iban(parts.Value, levels)); }
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 Parse4(string value) => Assert.Null(IbanParts.Parse(value));
public static void Parse3(string value) { Assert.NotNull(IbanParts.Parse(value)); Assert.True(IbanParts.TryParse(value).IsSuccess); }
public static void Parse1() { Assert.Null(IbanParts.Parse(null)); Assert.False(IbanParts.TryParse(null).IsSuccess); }