コード例 #1
0
        public void IntFutureFailuer()
        {
            bool called = false;

            IFuture <int> success = Future.Failure <int>(new Exception());

            success.Recover((e) => { called = true; });

            Assert.That(called);
        }
コード例 #2
0
        public void FutureDoubleFailureFlatRecoveCalledOnce()
        {
            var error = new Exception();

            var other = m_future.Map((x) => { return(x); }).FlatRecover((e) => Future.Failure <int>(error));

            m_promise.FulfillError(new Exception());

            int called = 0;

            other.Recover((e) => { called++; });

            Assert.AreEqual(1, called);
        }
コード例 #3
0
        public void FutureDoubleFailureFlatRecoveCalled()
        {
            var error = new Exception();

            var other = m_future.Map((x) => { return(x); }).FlatRecover((e) => Future.Failure <int>(error));

            m_promise.FulfillError(new Exception());

            bool called = false;

            other.Recover((e) => { called = true; });

            Assert.That(called);
        }