//--------------------------------------------------------------------
    public static void JumbleTestChildren(DataStructures.GenericNode <string> root)
    {
        DataStructures.GenericNode <string> child = null;

        child = root.FindDescNode("C1");
        child.ClearChildren(false);
        child.AddChild(new DataStructures.GenericNode <string>("D1", "D1", null), -1, false);
        child.AddChild(new DataStructures.GenericNode <string>("D2", "D2", null), -1, false);
        child.AddChild(new DataStructures.GenericNode <string>("D3", "D3", null), -1, false);

        child = root.FindDescNode("C5");
        child.ClearChildren(false);

        return;
    }
    public void Test_12_CountingVisitorOnC1()
    {
        DataStructures.GenericNode <string> root = new DataStructures.GenericNode <string>();
        GenericNodeTestData.AddTestChildren(root);
        root = root.FindDescNode("C1");

        this._AssertCountingVisitor(root, DataStructures.VisitationType.None, 0);
        this._AssertCountingVisitor(root, DataStructures.VisitationType.Parents, 3);
        this._AssertCountingVisitor(root, DataStructures.VisitationType.PreviousSiblings, 0);
        this._AssertCountingVisitor(root, DataStructures.VisitationType.NextSiblings, 2);
        this._AssertCountingVisitor(root, DataStructures.VisitationType.PreviousNodes, 3);
        this._AssertCountingVisitor(root, DataStructures.VisitationType.NextNodes, 11);
        this._AssertCountingVisitor(root, DataStructures.VisitationType.Children, 3);
        // Not Implemented: this._AssertCountingVisitor( root, DataStructures.VisitationType.DecendentsBreadthFirst, 0 );
        this._AssertCountingVisitor(root, DataStructures.VisitationType.DecendentsDepthFirst, 3);

        return;
    }
 //--------------------------------------------------------------------
 public static void AssertTestChildren(DataStructures.GenericNode <string> root)
 {
     Assert.AreEqual("D3", root.FindDescNode("C2").PrevNode.Value.ToString(), "D3 = C2.Prev");
     Assert.AreEqual("C3", root.FindDescNode("C2").NextNode.Value.ToString(), "C3 = C2.Next");
     Assert.AreEqual("A1", root.FindDescNode("C1").FirstNode.FirstChildNode.Value.ToString(), "A1 = C1.First.FirstChild");           // Special case.
     Assert.AreEqual("C7", root.FindDescNode("C1").LastNode.Value.ToString(), "C7 = C1.Last");
     Assert.AreEqual("A1", root.FindDescNode("C1").RootNode.FirstChildNode.Value.ToString(), "A1 = C1.Root.FirstChild");             // Special case.
     Assert.AreEqual("B1", root.FindDescNode("C1").ParentNode.Value.ToString(), "B1 = C1.Parent");
     Assert.AreEqual("C1", root.FindDescNode("C2").PrevSibNode.Value.ToString(), "C1 = C2.PrevSib");
     Assert.AreEqual("C2", root.FindDescNode("C1").NextSibNode.Value.ToString(), "C2 = C1.NextSib");
     Assert.AreEqual("C1", root.FindDescNode("C1").FirstSibNode.Value.ToString(), "C1 = C1.FirstSib");
     Assert.AreEqual("C3", root.FindDescNode("C1").LastSibNode.Value.ToString(), "C3 = C1.LastSib");
     Assert.AreEqual("B1", root.FindDescNode("A1").FirstChildNode.Value.ToString(), "B1 = A1.FirstChild");
     Assert.AreEqual("B3", root.FindDescNode("A1").LastChildNode.Value.ToString(), "B3 = A1.LastChild");
     Assert.AreEqual("B1", root.FindDescNode("A1").FirstDescNode.Value.ToString(), "B1 = A1.FirstDesc");
     Assert.AreEqual("C7", root.FindDescNode("A1").LastDescNode.Value.ToString(), "C7 = A1.LastDesc");
     return;
 }