Esempio n. 1
0
        public static string OrTests(string leftVal, string rightVal)
        {
            var left  = UpdateTests.MakeUpdate(leftVal);
            var right = UpdateTests.MakeUpdate(rightVal);

            return((left || right).ToString());
        }
Esempio n. 2
0
 public static string WhereTests(string val)
 {
     return((from x in UpdateTests.MakeUpdate(val)
             where x == "B"
             select x.Length)
            .ToString());
 }
Esempio n. 3
0
        public static bool EqualsTests(string leftVal, string rightVal)
        {
            var left  = UpdateTests.MakeUpdate(leftVal);
            var right = UpdateTests.MakeUpdate(rightVal);

            return(left.Equals(right));
        }
Esempio n. 4
0
 public static string ToEitherRightTests(string val, int rightValue)
 {
     return(UpdateTests
            .MakeUpdate(val)
            .ToEitherRight(rightValue)
            .ToString());
 }
Esempio n. 5
0
 public static string ToOptionTests(string val)
 {
     return(UpdateTests
            .MakeUpdate(val)
            .ToOption()
            .ToString());
 }
Esempio n. 6
0
 public static string MapTests(string val)
 {
     return(UpdateTests
            .MakeUpdate(val)
            .Pipe(Update.Map <string, string>(x => x.ToLower()))
            .ToString());
 }
Esempio n. 7
0
        public static string ResolveTests(string val, string existingVal)
        {
            var update   = UpdateTests.MakeUpdate(val);
            var existing = existingVal is string a?Option.Some(a) : Option <string> .None;

            return(update.Resolve(existing).ToString());
        }
Esempio n. 8
0
 public static string FilterTests(string val)
 {
     return(UpdateTests
            .MakeUpdate(val)
            .Pipe(Update.Filter <string>(x => x == "B"))
            .ToString());
 }
Esempio n. 9
0
 public static string BindTests(string val, bool returnValue)
 {
     return(UpdateTests
            .MakeUpdate(val)
            .Pipe(Update.Bind <string, int>(x => returnValue ? Update.Set(x.Length) : Update.Ignore <int>()))
            .ToString());
 }
Esempio n. 10
0
        public static string OfTypeTests(string val, bool wrapValue)
        {
            var innerUpdate = UpdateTests.MakeUpdate(val);

            return((wrapValue ? innerUpdate.ToUpdate() : Update.Ignore <Update <string> >())
                   .Pipe(Update.OfType <Update <string>, UpdateSet <string> >())
                   .ToString());
        }
Esempio n. 11
0
 public static string SelectManyTests(string val, bool returnSet)
 {
     return((from x in UpdateTests.MakeUpdate(val)
             from y in returnSet
                 ? Update.Ignore <bool>()
                 : (x.Length == 0).ToUpdate()
             select y)
            .ToString());
 }
Esempio n. 12
0
 public static string MatchTests(string val)
 {
     return(UpdateTests
            .MakeUpdate(val)
            .Pipe(Update.Match <string, string>(
                      x => $"Set: {x}",
                      () => "Do Nothing",
                      () => "Erase")));
 }
Esempio n. 13
0
 public static bool IsEmptyTests(string val)
 {
     return(UpdateTests.MakeUpdate(val).IsEmpty);
 }
Esempio n. 14
0
        public static object GetEnumeratorTests(string val)
        {
            var enumerator = ((IEnumerable)UpdateTests.MakeUpdate(val)).GetEnumerator();

            return(enumerator.MoveNext() ? enumerator.Current : null);
        }
Esempio n. 15
0
 public static string SelectTests(string val)
 {
     return((from x in UpdateTests.MakeUpdate(val)
             select x.Length)
            .ToString());
 }
Esempio n. 16
0
 public static string DefaultWithTests(string val)
 {
     return(UpdateTests
            .MakeUpdate(val)
            .Pipe(Update.DefaultWith("B")));
 }