예제 #1
0
            public static void Flatten_SomeOfSome_ForValueT()
            {
                // Arrange
                Maybe <Maybe <int> > square = Maybe.Some(One);

                // Act & Assert
                Assert.Equal(One, square.Flatten());
            }
예제 #2
0
            public static void Flatten_SomeOfSome_ForValueT_AndNullable()
            {
                // Arrange
                Maybe <int?>          one    = One.Select(x => (int?)x);
                Maybe <Maybe <int?> > square = Maybe.Some(one);

                // Act & Assert
                Assert.Equal(one, square.Flatten());
            }
예제 #3
0
            public static void Flatten_SomeOfSome_ForReferenceT_AndNullable()
            {
                // Arrange
                Maybe <AnyT?>          some   = AnyT.Some.Select(x => (AnyT?)x);
                Maybe <Maybe <AnyT?> > square = Maybe.Some(some);

                // Act & Assert
                Assert.Equal(some, square.Flatten());
            }