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