Esempio n. 1
0
            public void DoWork(ISessionFactory sessions)
            {
                var provider = new SessionFactoryProviderStub(sessions);
                var cf       = new DefaultConversationFactory(provider, new FakeSessionWrapper());
                var cca      = new NhConversationsContainerAccessor(provider);

                var tc1 = cca.Container;

                tc1.Bind(cf.CreateConversation("1"));

                var dao = new SillyDao(sessions);

                tc1.SetAsCurrent("1");
                tc1.CurrentConversation.Start();
                var o = new Other3 {
                    Name = "some other silly"
                };
                var e = new Silly3 {
                    Name = "somebody", Other = o
                };

                dao.MakePersistent(e);

                tc1.CurrentConversation.End();
            }
Esempio n. 2
0
        public void CreateCoversationStuff()
        {
            TestFixtureSetUp();
            var provider = new SessionFactoryProviderStub(sessions);

            cf  = new DefaultConversationFactory(provider, new FakeSessionWrapper());
            cca = new NhConversationsContainerAccessor(provider);
        }