Пример #1
0
        public void CatchMonadSuccessTest()
        {
            var m1 = new ParseStringMonad("12345");
            var m2 = m1.Catch(e => new SimpleMonad <int>(999));

            _Wait(m2);

            Assert.IsNull(m2.Error);
            Assert.AreEqual(m2.Result, 12345);
        }
Пример #2
0
        public void CatchMonadErrorTest()
        {
            var m1 = new ParseStringMonad("abcde");
            var m2 = m1.Catch(e => new SimpleMonad <int>(999));

            _Wait(m2);

            Assert.IsNull(m2.Error);
            Assert.AreEqual(m2.Result, 999);
        }