Пример #1
0
        public void MatchLeft_correctly_applies_logic_to_left()
        {
            var either = new LeftOrRight(new Left("Frodo"));
            var result = either.MatchLeft(x => x.Name);

            Assert.Equal(Optional.Create("Frodo"), result);
        }
Пример #2
0
        public void MatchLeft_correctly_returns_none_when_right_is_defined()
        {
            var either = new LeftOrRight(new Right(4));
            var result = either.MatchLeft(x => x.Name);

            Assert.Equal(Optional.None <string>(), result);
        }