protected void CommitSessionExpectingException() { bool exceptionThrow = false; try { Nh.CurrentSession.BeginTransaction().Commit(); } catch (Exception) { exceptionThrow = true; } finally { Nh.DisposeCurrentSession(); } if (!exceptionThrow) { Assert.Fail("Committing session expected to throw"); } }
protected virtual void CleanupNHibernateSession() { CurrentSessionContext.Unbind(NHibernateTestContext.CurrentContext.SessionFactory); Nh.DisposeCurrentSession(); }