Пример #1
0
        public void TestPostTraversal(List <int> expected, SungBinaryTreeNode <int> root)
        {
            var sut    = new SungBinaryTreeTraverser();
            var actual = sut.TraversePost(root).ToList();

            Assert.True(expected.SequenceEqual(actual));
        }
Пример #2
0
        public void TestBuildingTree(SungBinaryTreeNode <int> expected, int[] input)
        {
            var actual = new SungBinaryTreeBuilder().Build(input);

            var traverser    = new SungBinaryTreeTraverser();
            var expectedList = traverser.TraversePost(expected);
            var actualList   = traverser.TraversePost(actual);

            Assert.True(expectedList.SequenceEqual(actualList));
        }