示例#1
0
        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();
            }
        }
示例#3
0
 public void TestCleanup()
 {
     CurrentContext.DisposeSession(session);
 }