public void ShouldNotCloseClosedConnectionDuringCleanUp() { _connectionMock.Setup(x => x.State).Returns(ConnectionState.Closed); var connectionHandler = new ConnectionHandler().GetHandler(_dbCommandMock.Object, _transactionWrapperMock.Object); connectionHandler.RollbackTransactionAndCloseConnection(); _connectionMock.Verify(x => x.Close(), Times.Never()); }
public void ShouldNotRollbackTransactionWhenNoTransactionIsInProgress() { _transactionWrapperMock.Setup(x => x.TransactionInProgress).Returns(false); var connectionHandler = new ConnectionHandler().GetHandler(_dbCommandMock.Object, _transactionWrapperMock.Object); connectionHandler.RollbackTransactionAndCloseConnection(); _transactionWrapperMock.Verify(x => x.Rollback(), Times.Never()); }