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