public void TestConnectTheTreeToTheNode() { //K //| //A B //|\ \ //C D E // / \ / \ // F G H I // \/ // J SortedTree <ClassAsTreeValue <string> > tree = new SortedTree <ClassAsTreeValue <string> >(); AddNodeWholeTreeTestHelper(ref tree); SortedTree <ClassAsTreeValue <string> > tree2 = tree.GetSubtreeFromNode(B); //tree2: // B // | // E // / \ // H I // | // J AreEqualGetFroeachRepresentationHelper("JHIEB", tree2, "prep step1"); tree2.RemoveValue(J, false); AreEqualGetFroeachRepresentationHelper("HIEB", tree2, "prep step2"); tree.RemoveValue(B, false); AreEqualGetFroeachRepresentationHelper("CFJGDAK", tree, "prep step3"); //main test //K //| //A //|\ //C D // / \ // F G // \ // J // / // B // | // E // / \ // H I tree.ConnectTheTreeToTheNode(J, 0, tree2, 0); AreEqualGetFroeachRepresentationHelper("CFHIEBJGDAK", tree, "main test"); }