Exemplo n.º 1
0
		public void CreateNewConversationWithoutId()
		{
			var cf = new DefaultConversationFactory(new SessionFactoryProvider(), new FakeSessionWrapper());
			var nc = cf.CreateConversation();
			Assert.That(nc, Is.Not.Null);
			Assert.That(cf.CreateConversation(), Is.Not.EqualTo(nc));
		}
Exemplo n.º 2
0
		public void CreateConversationWithId()
		{
			var cf = new DefaultConversationFactory(new SessionFactoryProvider(), new FakeSessionWrapper());
			var nc = cf.CreateConversation("MyId");
			Assert.That(nc, Is.Not.Null);
			Assert.That(cf.CreateConversation("MyId"), Is.Not.SameAs(nc));
		}
Exemplo n.º 3
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();
            }