Beispiel #1
0
        public void DeleteNode_LastChild()
        {
            var r = new MapNode(new MapTree(), "r");
            var c1 = new MapNode(r, "c1");
            var cc1 = new MapNode(c1, "cc1");
            var cc2 = new MapNode(c1, "cc2");
            var c2 = new MapNode(r, "c2");

            cc2.DeleteNode();

            Assert.AreEqual(c1.LastChild, cc1);
        }
Beispiel #2
0
        public void DeleteNode_RootNode()
        {
            var r = new MapNode(new MapTree(), "r");
            var c1 = new MapNode(r, "c1");
            var cc1 = new MapNode(c1, "cc1");
            var cc2 = new MapNode(c1, "cc2");
            var c2 = new MapNode(r, "c2");

            r.DeleteNode();

            Assert.AreEqual(r, r.Tree.RootNode);
        }
Beispiel #3
0
        public void LastSelectedChild()
        {
            var r = new MapNode(new MapTree(), "r");
            var c1 = new MapNode(r, "c1");
            var c11 = new MapNode(c1, "cc1");
            var c12 = new MapNode(c1, "cc2");
            var c2 = new MapNode(r, "c2");

            c12.Selected = true;
            c12.DeleteNode();

            Assert.IsNull(c1.LastSelectedChild);
        }