public void ConversationIsCanceledAfterSilentError() { using (var c = new ScopedConversation()) { c.ExecuteSilently(() => new PostLazy().SaveWithException()); Assert.That(c.IsCanceled); } }
public void TriggersWithRightArgsWhenCancelingAfterException() { bool triggered = false; Exception ex = null; using (var c = new ScopedConversation()) { c.Canceled += (conv, args) => { triggered = true; ex = args.Exception; }; c.ExecuteSilently(() => new PostLazy().SaveWithException()); } Assert.That(triggered); Assert.That(ex, Is.Not.Null .And.InstanceOf <ApplicationException>()); }
public void TriggersWithRightArgsWhenCancelingAfterException() { bool triggered = false; Exception ex = null; using (var c = new ScopedConversation()) { c.Canceled += (conv, args) => { triggered = true; ex = args.Exception; }; c.ExecuteSilently(()=>new PostLazy().SaveWithException()); } Assert.That(triggered); Assert.That(ex, Is.Not.Null .And.InstanceOf<ApplicationException>()); }