Example #1
0
        public void RemoveNodeChainTwice()
        {
            var dict    = BuildTestTree();
            var command = new RemoveNodeChainCommand(new NullDb(), dict["Node 1"], true);

            command.Execute();
        }
Example #2
0
        public void RemoveNodeChainUndoBeforeExecute()
        {
            var dict    = BuildTestTree();
            var command = new RemoveNodeChainCommand(new NullDb(), dict["Node 1"]);

            command.Undo();
        }
Example #3
0
        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);
        }