public void Catch_throwing_exception_should_not_prevent_the_catch_call_on_subsequent_promises() { bool call = false; Promise promise = new Promise(); IPromise promise1 = promise.OnError(delegate(Exception exc) { throw new Exception(); }); promise1.OnError(delegate(Exception exc) { call = true; }); Assert.DoesNotThrow(new Assert.ThrowsDelegate(delegate() { promise.Reject(null); })); //Catch throwing exception should not prevent the catch call on subsequent promises Assert.True(call); }
public void First_promise_rejected_should_reject_all_subsequent_promises() { bool call1 = false; bool call2 = false; bool call3 = false; Promise promise1 = new Promise(); IPromise promise2 = promise1.OnError(delegate(Exception exc) { call1 = true; }); IPromise promise3 = promise2.OnError(delegate(Exception exc) { call2 = true; }); promise3.OnError(delegate(Exception exc) { call3 = true; }); promise1.Reject(new Exception()); Assert.True(call1); Assert.True(call2); Assert.True(call3); }