예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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));
        }
예제 #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);
        }
예제 #7
0
 public static void Parse2b(string value)
 {
     Assert.Null(Iban.Parse(value, IbanValidationLevels.Integrity));
     Assert.True(Iban.TryParse(value, IbanValidationLevels.Integrity).IsError);
 }
예제 #8
0
 public static void Parse2a(string value)
 {
     Assert.Null(Iban.Parse(value));
     Assert.True(Iban.TryParse(value).IsError);
 }
예제 #9
0
 public static void Parse7b(string value)
 {
     Assert.NotNull(Iban.Parse(value, IbanStyles.Any));
     Assert.True(Iban.TryParse(value, IbanStyles.Any).IsSuccess);
 }
예제 #10
0
 public static void Parse6a(string value)
 {
     Assert.Null(Iban.Parse(value, IbanStyles.AllowHeader));
     Assert.True(Iban.TryParse(value, IbanStyles.AllowHeader).IsError);
 }
예제 #11
0
 public static void Parse5(string value)
 {
     Assert.NotNull(Iban.Parse(value, IbanStyles.AllowLowercaseLetter));
     Assert.True(Iban.TryParse(value, IbanStyles.AllowLowercaseLetter).IsSuccess);
 }
예제 #12
0
 public static void Parse4f(string value)
 {
     Assert.NotNull(Iban.Parse(value, IbanStyles.AllowInnerWhite));
     Assert.True(Iban.TryParse(value, IbanStyles.AllowInnerWhite).IsSuccess);
 }
예제 #13
0
 public static void Parse4e(string value)
 {
     Assert.Null(Iban.Parse(value, IbanStyles.AllowInnerWhite));
     Assert.True(Iban.TryParse(value, IbanStyles.AllowInnerWhite).IsError);
 }
예제 #14
0
 public static void Parse3(string value)
 {
     Assert.NotNull(Iban.Parse(value));
     Assert.True(Iban.TryParse(value).IsSuccess);
 }