示例#1
0
        public void ManualBindSessionToConversationShouldUnbindOrphanedSession()
        {
            // TODO: recreate this test in ConversationFixtureBase to check the wrapper
            NhConversation c = NewStartedConversation();

            ISession s = sessions.OpenSession();

            Assert.That(Spying.Logger <NhConversation>().Execute(() => c.Bind(s)).WholeMessage,
                        Text.Contains("Already session bound on call to Bind()"));
            ISession sessionFromConversation = c.GetSession(sessions);

            Assert.That(c.Wrapper.IsWrapped(sessionFromConversation), "The new bind session should be wrapped and managed by the Wrapper.");
            Assert.That(sessionFromConversation.FlushMode, Is.EqualTo(FlushMode.Never), "The FlushMode of new bind session should be changed to Never.");
        }