Ejemplo n.º 1
0
 public void Rollback_Calls_Rollback_On_Underlying_ITransaction()
 {
     var mockContainer = MockRepository.GenerateMock<IObjectContainer>();
     var transaction = new Db4oTransaction(mockContainer);
     transaction.Rollback();
     mockContainer.AssertWasCalled(x => x.Rollback());
     mockContainer.VerifyAllExpectations();
 }
Ejemplo n.º 2
0
        public void Rollback_Calls_Rollback_On_Underlying_ITransaction()
        {
            var mockContainer = MockRepository.GenerateMock <IObjectContainer>();
            var transaction   = new Db4oTransaction(mockContainer);

            transaction.Rollback();
            mockContainer.AssertWasCalled(x => x.Rollback());
            mockContainer.VerifyAllExpectations();
        }
Ejemplo n.º 3
0
        public void Rollback_Raises_RollbackComitted_Event()
        {
            var mockContainer = MockRepository.GenerateMock<IObjectContainer>();

            var commitCalled = false;
            var rollbackCalled = false;
            var transaction = new Db4oTransaction(mockContainer);
            transaction.TransactionCommitted += delegate { commitCalled = true; };
            transaction.TransactionRolledback += delegate { rollbackCalled = true; };

            transaction.Rollback();
            Assert.That(!commitCalled);
            Assert.That(rollbackCalled);

            mockContainer.AssertWasCalled(x => x.Rollback());
            mockContainer.AssertWasNotCalled(x => x.Commit());
            mockContainer.VerifyAllExpectations();
        }
Ejemplo n.º 4
0
        public void Rollback_Raises_RollbackComitted_Event()
        {
            var mockContainer = MockRepository.GenerateMock <IObjectContainer>();

            var commitCalled   = false;
            var rollbackCalled = false;
            var transaction    = new Db4oTransaction(mockContainer);

            transaction.TransactionCommitted  += delegate { commitCalled = true; };
            transaction.TransactionRolledback += delegate { rollbackCalled = true; };

            transaction.Rollback();
            Assert.That(!commitCalled);
            Assert.That(rollbackCalled);

            mockContainer.AssertWasCalled(x => x.Rollback());
            mockContainer.AssertWasNotCalled(x => x.Commit());
            mockContainer.VerifyAllExpectations();
        }