示例#1
0
文件: TestMonad.cs 项目: rayark/mast
        public void ConcurrentMonad2ErrorTest()
        {
            var m1 = new BlockMonad <int>(TestTask1);
            var m2 = new BlockMonad <string>(TestTask2);

            var mc = new ConcurrentMonad <int, string>(m1, m2);

            _Wait(mc);

            Assert.AreEqual(default((int, string)), mc.Result);
            Assert.AreEqual(mc.Error.Message, "error 2");
        }
示例#2
0
文件: TestMonad.cs 项目: rayark/mast
        public void ConcurrentMonad2Test()
        {
            var m1 = new BlockMonad <int>(TestTask1);
            var m3 = new BlockMonad <string>(TestTask3);

            var mc = new ConcurrentMonad <int, string>(m1, m3);

            _Wait(mc);

            Assert.AreEqual(mc.Result.Item1, 10);
            Assert.AreEqual(mc.Result.Item2, "ok 3");
            Assert.IsNull(mc.Error);
        }