public void Executar(TCommand cmd) { _transactional.BeginTransaction(); try { _commandHandler.Executar(cmd); _transactional.Commit(); } catch { _transactional.Rollback(); throw; } }
public void Transactional_Unit_Rollback_NotChanged() { String currentValue = "Current"; String originalValue = currentValue; Transactional<String> target = new Transactional<String>(currentValue, originalValue); target.Rollback(); Assert.AreEqual(originalValue, target.CurrentValue); Assert.AreEqual(originalValue, target.OriginalValue); }