protected void VerifyCanCreateUseAndDisposeSession() { ISession session = null; try { session = CurrentContext.CreateSession(); Assert.IsNotNull(session); session.Save(new AREntity()); session.Flush(); } finally { CurrentContext.DisposeSession(session); } }
protected void VerifyCanCreateUseAndDisposeSession() { ISession session = null; try { if (IoC.IsNotInitialized) { IoC.Initialize(); } CurrentContext.CreateUnitOfWork(); session = CurrentContext.CreateSession(); Assert.IsNotNull(session); session.Save(new GuidEntityForTesting()); session.Flush(); } finally { CurrentContext.DisposeSession(session); CurrentContext.DisposeUnitOfWork(); } }
public void TestCleanup() { CurrentContext.DisposeSession(session); }