public void ExceptionsInExecuteSilentlyCancelTheConversationWithoutThrowing() { var sf = MockRepository.GenerateStub<ISessionFactory>(); var cc = MockRepository.GenerateStub<INhConversationContext>(); var c = new NhConversation(sf, cc); var e = new Exception("foo"); ConversationCanceledEventArgs eventRaised = null; object eventRaiser = null; c.Canceled += (o, a) => { eventRaiser = o; eventRaised = a; }; c.ExecuteSilently(() => { throw e; }); // Doesn't throw. Assert.That(eventRaised, Is.Not.Null); Assert.That(eventRaised.CanceledByUser, Is.False); Assert.That(eventRaised.Exception, Is.SameAs(e)); Assert.That(eventRaiser, Is.SameAs(c)); }