Beispiel #1
0
        public static IEnumerator WhilePending(IPromise p)
        {
            bool isPending = true;

            p.Finally(() => isPending = false);
            return(new WaitWhile(() => isPending));
        }
        public void Finally_throwing_exception_should_not_prevent_the_finally_call_on_subsequent_promises()
        {
            bool call = false;

            Promise  promise  = new Promise();
            IPromise promise1 = promise.Finally(delegate() { throw new Exception(); });

            promise1.Finally(delegate() { call = true; });

            Assert.DoesNotThrow(new Assert.ThrowsDelegate(delegate() { promise.Finally(); }));
            //Finally throwing exception should not prevent the catch call on subsequent promises
            Assert.True(call);
        }
Beispiel #3
0
 public IPromise Finally(Action action)
 {
     return(_promise.Finally(action));
 }