Ejemplo n.º 1
0
 public void ConversationIsCanceledAfterSilentError()
 {
     using (var c = new ScopedConversation())
     {
         c.ExecuteSilently(() => new PostLazy().SaveWithException());
         Assert.That(c.IsCanceled);
     }
 }
Ejemplo n.º 2
0
        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>());
        }
 public void ConversationIsCanceledAfterSilentError()
 {
     using (var c = new ScopedConversation())
     {
         c.ExecuteSilently(() => new PostLazy().SaveWithException());
         Assert.That(c.IsCanceled);
     }
 }