public void MoveNodeChainTwice() { var dict = BuildTestTree(); var command = new MoveNodeCommand(new NullDb(), dict["Node 1"], dict["Node 2"], true); command.Execute(); }
public void MoveNodeAndUndo() { var dict = BuildTestTree(); var command = new MoveNodeCommand(new NullDb(), dict["Node 1"], dict["Node 2"]); Assert.AreEqual(defaultTestTree, StringifyTree(dict["Problem"])); command.Execute(); Assert.AreEqual("Problem,Node 2,Node 1,Node 1.1,Node 1.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); }