public void Dispose_Method()
 {
   using (var connection = this.sessionFactory.OpenSession())
   {
     var transaction = new NHibernateTransaction(connection);
     transaction.Dispose();
     Assert.True(transaction.Field("disposed").To<bool>());
     Assert.False(transaction.Field("wasCommitted").To<bool>());
     Assert.False(transaction.Field("wasRolledBack").To<bool>());
     Assert.Throws<ObjectDisposedException>(() => transaction.Dispose());
   }
 }
예제 #2
0
 public void Dispose_Method()
 {
     using (var connection = this.sessionFactory.OpenSession())
     {
         var transaction = new NHibernateTransaction(connection);
         transaction.Dispose();
         Assert.True(transaction.Field("disposed").To <bool>());
         Assert.False(transaction.Field("wasCommitted").To <bool>());
         Assert.False(transaction.Field("wasRolledBack").To <bool>());
         Assert.Throws <ObjectDisposedException>(() => transaction.Dispose());
     }
 }