예제 #1
0
            public void ApplyOption_OnSome_WhenResultIsNullReference_IsTypedNone()
            {
                Option <TestObject> some = new TestObject();

                var result = some.Apply <TestObject>(_ => null);

                result.Should().BeOfType <None <TestObject> >();
            }
예제 #2
0
            public void Apply_OnSome_ReturnsResultTypeSome()
            {
                Option <TestObject> some = new TestObject();

                var result = some.Apply(obj => obj.Property);

                result.Should().BeOfType <Some <TestObject.TestProperty> >();
            }
예제 #3
0
            public void Apply_OnSome_WhenResultIsNoneValue_IsTypedNone()
            {
                Option <TestObject> some = new TestObject();

                var result = some.Apply <TestObject>(_ => None.Value);

                result.Should().BeOfType <None <TestObject> >();
            }