Exemple #1
0
        public static void Create1(string value)
        {
            var iban   = Iban.Parse(value).Value;
            var result = Iban.Create(iban.CountryCode, iban.CheckDigits, iban.Bban);

            Assert.Equal(iban, result);
        }
Exemple #2
0
        public static void Parse6b()
        {
            var value = "IBAN AL47212110090000000235698741";

            Assert.NotNull(Iban.Parse(value, IbanStyles.AllowHeader));
            Assert.True(Iban.TryParse(value, IbanStyles.AllowHeader).IsSuccess);
        }
Exemple #3
0
        public static void Build1(string value)
        {
            var iban   = Iban.Parse(value).Value;
            var result = Iban.Build(iban.CountryCode, iban.Bban);

            Assert.Equal(iban, result);
        }
Exemple #4
0
        public static void CheckIntegrity1(string value, string expectedBban)
        {
            var iban = Iban.Parse(value, IbanStyles.None, IbanValidationLevels.None).Value;

            var result = Iban.CheckIntegrity(iban);

            Assert.False(result.HasValue);
        }
Exemple #5
0
        public static void CheckIntegrity3(string value)
        {
            var iban = Iban.Parse(value, IbanStyles.None, IbanValidationLevels.Integrity).Value;

            var result = Iban.CheckIntegrity(iban);

            Assert.True(result.HasValue);
            Assert.True(result.Value.VerificationLevels.Contains(IbanValidationLevels.Integrity));
        }
Exemple #6
0
        public static void Parse7a()
        {
            Assert.Null(Iban.Parse("", IbanStyles.Any));
            Assert.True(Iban.TryParse("", IbanStyles.Any).IsError);

            Assert.Null(Iban.Parse(" ", IbanStyles.Any));
            Assert.True(Iban.TryParse(" ", IbanStyles.Any).IsError);

            Assert.Null(Iban.Parse("X ", IbanStyles.Any));
            Assert.True(Iban.TryParse("X ", IbanStyles.Any).IsError);

            Assert.Null(Iban.Parse(" X", IbanStyles.Any));
            Assert.True(Iban.TryParse(" X", IbanStyles.Any).IsError);

            Assert.Null(Iban.Parse("X X", IbanStyles.Any));
            Assert.True(Iban.TryParse("X X", IbanStyles.Any).IsError);
        }
Exemple #7
0
 public static void Parse2b(string value)
 {
     Assert.Null(Iban.Parse(value, IbanValidationLevels.Integrity));
     Assert.True(Iban.TryParse(value, IbanValidationLevels.Integrity).IsError);
 }
Exemple #8
0
 public static void Parse2a(string value)
 {
     Assert.Null(Iban.Parse(value));
     Assert.True(Iban.TryParse(value).IsError);
 }
Exemple #9
0
 public static void Parse7b(string value)
 {
     Assert.NotNull(Iban.Parse(value, IbanStyles.Any));
     Assert.True(Iban.TryParse(value, IbanStyles.Any).IsSuccess);
 }
Exemple #10
0
 public static void Parse6a(string value)
 {
     Assert.Null(Iban.Parse(value, IbanStyles.AllowHeader));
     Assert.True(Iban.TryParse(value, IbanStyles.AllowHeader).IsError);
 }
Exemple #11
0
 public static void Parse5(string value)
 {
     Assert.NotNull(Iban.Parse(value, IbanStyles.AllowLowercaseLetter));
     Assert.True(Iban.TryParse(value, IbanStyles.AllowLowercaseLetter).IsSuccess);
 }
Exemple #12
0
 public static void Parse4f(string value)
 {
     Assert.NotNull(Iban.Parse(value, IbanStyles.AllowInnerWhite));
     Assert.True(Iban.TryParse(value, IbanStyles.AllowInnerWhite).IsSuccess);
 }
Exemple #13
0
 public static void Parse4e(string value)
 {
     Assert.Null(Iban.Parse(value, IbanStyles.AllowInnerWhite));
     Assert.True(Iban.TryParse(value, IbanStyles.AllowInnerWhite).IsError);
 }
Exemple #14
0
 public static void Parse3(string value)
 {
     Assert.NotNull(Iban.Parse(value));
     Assert.True(Iban.TryParse(value).IsSuccess);
 }