Exemple #1
0
        public void WaitAllConcurrentMonad2Test()
        {
            var m1 = new BlockMonad <int>(TestTask1);
            var m3 = new BlockMonad <string>(TestTask3);

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

            _Wait(mc);

            Assert.AreEqual(mc.Result.Item1.Result, 10);
            Assert.AreEqual(mc.Result.Item2.Result, "ok 3");
            Assert.IsNull(mc.Error);
        }
Exemple #2
0
        public void WaitAllConcurrentMonad2ErrorTest()
        {
            var m1 = new BlockMonad <int>(TestTask1);
            var m2 = new BlockMonad <string>(TestTask2);

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

            _Wait(mc);

            Assert.IsNull(mc.Error);

            Assert.AreEqual(10, mc.Result.Item1.Result);
            Assert.IsNull(mc.Result.Item1.Error);

            Assert.IsNull(mc.Result.Item2.Result);
            Assert.AreEqual(mc.Result.Item2.Error.Message, "error 2");
        }