public void Must_first_begin_a_transaction_before_rolling_back()
        {
            using (_mocks.Record())
             {
            Expect.Call(this._mockTransaction.IsActive).Return(false);
             }

             using (_mocks.Playback())
             {
            NHibernateTransactionWrapper transactionWrapper = new NHibernateTransactionWrapper(this._mockTransaction);
            // transaction.Begin(); <- We didn't start (or begin) it yet!
            transactionWrapper.Rollback();
             }
        }
        public void Cannot_rollback_an_already_committed_transaction()
        {
            using (_mocks.Record())
             {
            Expect.Call(this._mockTransaction.IsActive).Return(true);
            this._mockTransaction.Commit();
            Expect.Call(this._mockTransaction.IsActive).Return(false);
             }

             using (_mocks.Playback())
             {
            NHibernateTransactionWrapper transactionWrapper = new NHibernateTransactionWrapper(this._mockTransaction);
            transactionWrapper.Commit();
            transactionWrapper.Rollback();
             }
        }
        public void Should_delegate_commit_to_underlying_NHibernate_transaction()
        {
            using (_mocks.Record())
             {
            Expect.Call(this._mockTransaction.IsActive).Return(true);
            this._mockTransaction.Commit();
             }

             using (_mocks.Playback())
             {
            NHibernateTransactionWrapper transaction2 = new NHibernateTransactionWrapper(this._mockTransaction);
            transaction2.Commit();
             }
        }
        public void Should_automatically_rollback_if_uncommitted_transaction_is_disposed()
        {
            using (_mocks.Record())
             {
            Expect.Call(this._mockTransaction.IsActive).Return(true);
            this._mockTransaction.Rollback();
            Expect.Call(this._mockTransaction.IsActive).Return(true);
            this._mockTransaction.Dispose();
             }

             using (_mocks.Playback())
             {
            NHibernateTransactionWrapper transactionWrapper = new NHibernateTransactionWrapper(this._mockTransaction);
            transactionWrapper.Dispose();
             }
        }