public void RemoveNodeChainTwice() { var dict = BuildTestTree(); var command = new RemoveNodeChainCommand(new NullDb(), dict["Node 1"], true); command.Execute(); }
public void RemoveNodeChainUndoBeforeExecute() { var dict = BuildTestTree(); var command = new RemoveNodeChainCommand(new NullDb(), dict["Node 1"]); command.Undo(); }
public void RemoveNodeChainAndUndo() { var dict = BuildTestTree(); var command = new RemoveNodeChainCommand(new NullDb(), dict["Node 1"]); Assert.AreEqual(defaultTestTree, StringifyTree(dict["Problem"])); command.Execute(); Assert.AreEqual("Problem,Node 2,Node 2.1,Node 2.1.1,Node 2.2", StringifyTree(dict["Problem"])); Assert.AreEqual(true, command.Executed); command.Undo(); Assert.AreEqual(defaultTestTree, StringifyTree(dict["Problem"])); Assert.AreEqual(false, command.Executed); }