Exemplo n.º 1
0
        public void ShouldGetDepthFirstUpwards()
        {
            _treeWalker = new TreeWalker <TreeNode>(5, new Tree(3));
            var actual = _treeWalker.GetAncestorsDepthFirst(5).Select(i => i.Value).ToList();

            CollectionAssert.AreEqual(
                new List <int> {
                4, 8, 9, 2, 3, 6, 12, 13, 7, 14, 15, 1
            }, actual, string.Join(", ", actual));
        }