Esempio n. 1
0
        private static bool UnitTest1()
        {
            var leaves = new List <int>();

            LeafSimilarCheck.GetLeaves(GetTreeOne(), leaves);

            if (!leaves.SequenceEqual(new[] { 6, 7, 4, 9, 8 }))
            {
                Console.WriteLine("Failed test 1- checking leaf sequence");
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        private static bool UnitTest2()
        {
            var root1 = GetTreeOne();
            var root2 = GetTreeOne();

            var result = LeafSimilarCheck.LeafSimilar(root1, root2);

            if (!result)
            {
                Console.WriteLine("Failed unit test 2 - comparing two equal trees");
            }

            return(result);
        }