public void CanRestartAConversationWithFreshSessions()
        {
            ISession s1, s2;

            using (var c = new ScopedConversation())
            {
                using (new ConversationalScope(c))
                {
                    BlogLazy.FindAll();
                    s1 = BlogLazy.Holder.CreateSession(typeof(BlogLazy));
                }

                c.Restart();

                using (new ConversationalScope(c))
                {
                    BlogLazy.FindAll();
                    s2 = BlogLazy.Holder.CreateSession(typeof(BlogLazy));
                }

                Assert.That(s1, Is.Not.SameAs(s2));
                Assert.That(s1.IsOpen, Is.False);
                Assert.That(s2.IsOpen, Is.True);
            }
        }
 public void CanRestartAConversation()
 {
     using (var c = new ScopedConversation())
     {
         Assert.That(c.IsCanceled, Is.False);
         c.Cancel();
         Assert.That(c.IsCanceled);
         c.Restart();
         Assert.That(c.IsCanceled, Is.False);
     }
 }
示例#3
0
 public void CanRestartAConversation()
 {
     using (var c = new ScopedConversation())
     {
         Assert.That(c.IsCanceled, Is.False);
         c.Cancel();
         Assert.That(c.IsCanceled);
         c.Restart();
         Assert.That(c.IsCanceled, Is.False);
     }
 }
    	public void CanRestartAConversationWithFreshSessions()
    	{
    		ISession s1, s2;
    		using (var c = new ScopedConversation())
    		{
    			using (new ConversationalScope(c))
    			{
    				BlogLazy.FindAll();
    				s1 = BlogLazy.Holder.CreateSession(typeof (BlogLazy));
    			}
				
				c.Restart();

				using (new ConversationalScope(c))
				{
					BlogLazy.FindAll();
					s2 = BlogLazy.Holder.CreateSession(typeof(BlogLazy));
				}    			

				Assert.That(s1, Is.Not.SameAs(s2));
    			Assert.That(s1.IsOpen, Is.False);
    			Assert.That(s2.IsOpen, Is.True);
    		}
    	}