public void RestartingTheConversationResetsCancelState() { var t = MockRepository.GenerateStub<ITransaction>(); var s = MockRepository.GenerateStub<ISession>(); var sf = MockRepository.GenerateStub<ISessionFactory>(); var cc = MockRepository.GenerateStub<INhConversationContext>(); sf.Stub(x => x.OpenSession()).Return(s); s.Stub(x => x.BeginTransaction()).IgnoreArguments().Return(t); var c = new NhConversation(sf, cc); c.Cancel(); c.Restart(); bool called = false; c.Execute(x => called = true); // Call doesn't matter, it's a stub Assert.That(called); }