public void CanNotExecuteRolledBack() { CommandTester tester = new CommandTester(() => true, () => { }, true); tester.Execute(); tester.Rollback(); InvalidOperationException exception = Assert.Throws <InvalidOperationException>(() => tester.Execute()); Assert.IsTrue(exception.Message.Contains(tester.Name)); }
public void Rollback(bool executeActionResult) { bool executeAction = false; bool rollbackAction = false; CommandTester tester = new CommandTester(() => { { executeAction = true; return(executeActionResult); } }, () => { rollbackAction = true; }, true); Assert.AreEqual(executeActionResult, tester.Execute()); tester.Rollback(); Assert.IsTrue(executeAction); Assert.IsTrue(rollbackAction); }