Ejemplo n.º 1
0
        public void ListValuesInDepthFirstOrderWithEnumerator()
        {
            int            expectedValue = 6;
            DemoTree <int> myTree        = CreateTreeWithValues(expectedValue);

            DisplayTree(myTree);
            var valuesString = String.Join(" ", myTree.ToArray());

            Assert.AreEqual("1 2 4 5 3 6", valuesString);
        }
Ejemplo n.º 2
0
        public void ListValuesInBreadthFirstOrderWithEnumerator()
        {
            int            expectedValue = 14;
            DemoTree <int> myTree        = CreateTreeWithValues(expectedValue);

            myTree.UseBreadthFirstEnumerator = true;

            DisplayTree(myTree);
            var valuesString = String.Join(" ", myTree.ToArray());

            Assert.AreEqual("1 2 3 4 5 6 7 8 9 12 13 10 11 14", valuesString);
        }