public void TestPostTraversal(List <int> expected, SungBinaryTreeNode <int> root) { var sut = new SungBinaryTreeTraverser(); var actual = sut.TraversePost(root).ToList(); Assert.True(expected.SequenceEqual(actual)); }
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)); }