Ejemplo n.º 1
0
        public static void OperatorNotEquals_SameType_SameState_DifferentValue(UnequalPair <Guid> values)
        {
            var left  = Either.From <Guid, Version>(values.Left);
            var right = Either.From <Guid, Version>(values.Right);

            Assert.True(left != right);
            Assert.True(right != left);
        }
Ejemplo n.º 2
0
        public static void DefaultIfEmpty_Right(UnequalPair <int> values)
        {
            var actual = Either.From <string, int>(values.Right).Recover(values.Left);

            Assert.True(actual.IsRight);
            var innerValue = (int)actual;

            Assert.Equal(values.Right, innerValue);
        }
Ejemplo n.º 3
0
        public static void SelectManyResult_SomeSome(UnequalPair <int> values, Func <int, int, int> selector)
        {
            var(left, right) = values;
            var actual = from l in Option.From(left)
                         from r in Option.From(right)
                         select selector(l, r);

            Assert.True(actual.IsSome);
            var innerValue = actual.Value;

            Assert.Equal(selector(left, right), innerValue);
        }
Ejemplo n.º 4
0
 public static void Contains_Right_False(UnequalPair <Version> values) =>
 Assert.False(Either.From <Guid, Version>(values.Right).Contains(values.Left));