public void Commit_Does_Not_Commit_Transaction_If_Transaction_InActive() { // Arrange var uow = new UnitOfWork(_session, _transaction); // Act uow.Commit(); // Assert _transaction.AssertWasNotCalled(trans => trans.Commit()); }
public void Commit_Commits_Transaction_If_Transaction_Active() { // Arrange _transaction.Stub(trans => trans.IsActive) .Return(true); var uow = new UnitOfWork(_session, _transaction); // Act uow.Commit(); // Assert _transaction.AssertWasCalled(trans => trans.Commit()); }