Exemplo n.º 1
0
        public void PerformStatelessPieceOfOperation(IStatelessSession previousSession)
        {
            Assert.IsNotNull(previousSession);

            using (IStatelessSession session = sessManager.OpenStatelessSession())
            {
                Assert.IsNotNull(session);
                Assert.IsTrue(StatelessSessionDelegate.AreEqual(session, previousSession));
            }
        }
Exemplo n.º 2
0
        public void SharedStatelessSession()
        {
            var manager = container.Resolve <ISessionManager>();

            IStatelessSession session1 = manager.OpenStatelessSession();
            IStatelessSession session2 = manager.OpenStatelessSession();
            IStatelessSession session3 = manager.OpenStatelessSession();

            Assert.IsNotNull(session1);
            Assert.IsNotNull(session2);
            Assert.IsNotNull(session3);

            Assert.IsTrue(StatelessSessionDelegate.AreEqual(session1, session2));
            Assert.IsTrue(StatelessSessionDelegate.AreEqual(session1, session3));

            session3.Dispose();
            session2.Dispose();
            session1.Dispose();

            Assert.IsTrue(container.Resolve <ISessionStore>().IsCurrentActivityEmptyFor(Constants.DefaultAlias));
        }