예제 #1
0
        public void EitherTestAssignLeft()
        {
            var             item   = new T1();
            Either <T1, T2> either = new T2();

            either.Set(item);

            Assert.IsTrue(either.IsLeft);
            Assert.IsFalse(either.IsRight);
            Assert.AreEqual(item, either.GetLeft());
            Assert.ThrowsException <InvalidCastException>(() => either.GetRight());
        }