public void Rollback_Calls_Rollback_On_Underlying_ITransaction() { var mockTransaction = MockRepository.GenerateMock<IDbTransaction>(); mockTransaction.Expect(x => x.Rollback()).IgnoreArguments(); var transaction = new EFTransaction(mockTransaction); transaction.Rollback(); mockTransaction.VerifyAllExpectations(); }
public void Rollback_Calls_Rollback_On_Underlying_ITransaction() { var mockTransaction = MockRepository.GenerateMock <IDbTransaction>(); mockTransaction.Expect(x => x.Rollback()).IgnoreArguments(); var transaction = new EFTransaction(mockTransaction); transaction.Rollback(); mockTransaction.VerifyAllExpectations(); }
public void Rollback_Raises_RollbackComitted_Event() { var mockTransaction = MockRepository.GenerateMock <IDbTransaction>(); mockTransaction.Expect(x => x.Rollback()); bool commitCalled = false; bool rollbackCalled = false; var transaction = new EFTransaction(mockTransaction); transaction.TransactionCommitted += delegate { commitCalled = true; }; transaction.TransactionRolledback += delegate { rollbackCalled = true; }; transaction.Rollback(); mockTransaction.VerifyAllExpectations(); Assert.That(!commitCalled); Assert.That(rollbackCalled); }
public void Rollback_Raises_RollbackComitted_Event() { var mockTransaction = MockRepository.GenerateMock<IDbTransaction>(); mockTransaction.Expect(x => x.Rollback()); bool commitCalled = false; bool rollbackCalled = false; var transaction = new EFTransaction(mockTransaction); transaction.TransactionCommitted += delegate { commitCalled = true; }; transaction.TransactionRolledback += delegate { rollbackCalled = true; }; transaction.Rollback(); mockTransaction.VerifyAllExpectations(); Assert.That(!commitCalled); Assert.That(rollbackCalled); }