public static void Deconstruct1()
        {
            var ok = Fallible.Ok;

            var(succeed, err) = ok;
            Assert.True(succeed);
            Assert.Null(err);
        }
Beispiel #2
0
        public static void Deconstruct2()
        {
            var nok = Fallible <Obj> .FromError(Error);

            var(succeed, value, err) = nok;
            Assert.False(succeed);
            Assert.Same(Error, err);
            Assert.Null(value);
        }
Beispiel #3
0
        public static void Deconstruct2()
        {
            var exp = new Obj();
            var nok = Result <string, Obj> .FromError(exp);

            var(succeed, value, err) = nok;
            Assert.False(succeed);
            Assert.Null(value);
            Assert.Same(exp, err);
        }
Beispiel #4
0
        public static void Deconstruct1()
        {
            var exp = new Obj();
            var ok  = Result <Obj, string> .Of(exp);

            var(succeed, value, err) = ok;
            Assert.True(succeed);
            Assert.Same(exp, value);
            Assert.Null(err);
        }
Beispiel #5
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);
        }
Beispiel #6
0
 public static void Parse2b(string value)
 {
     Assert.Null(Iban.Parse(value, IbanValidationLevels.Integrity));
     Assert.True(Iban.TryParse(value, IbanValidationLevels.Integrity).IsError);
 }
Beispiel #7
0
 public static void Parse2a(string value)
 {
     Assert.Null(Iban.Parse(value));
     Assert.True(Iban.TryParse(value).IsError);
 }
Beispiel #8
0
 public static void Parse6a(string value)
 {
     Assert.Null(Iban.Parse(value, IbanStyles.AllowHeader));
     Assert.True(Iban.TryParse(value, IbanStyles.AllowHeader).IsError);
 }
Beispiel #9
0
 public static void Parse4e(string value)
 {
     Assert.Null(Iban.Parse(value, IbanStyles.AllowInnerWhite));
     Assert.True(Iban.TryParse(value, IbanStyles.AllowInnerWhite).IsError);
 }
Beispiel #10
0
 public static void Parse4(string value) => Assert.Null(IbanParts.Parse(value));
Beispiel #11
0
 public static void Parse1()
 {
     Assert.Null(IbanParts.Parse(null));
     Assert.False(IbanParts.TryParse(null).IsSuccess);
 }