Beispiel #1
0
        public void Can_Perform_PreOrder_Traversal_And_Return_List()
        {
            KAryTree <int> testTree = PopulateTestTree();
            List <int>     actual   = testTree.PreOrder();
            List <int>     expected = new List <int>()
            {
                3, 4, 7, 13, 30, 5, 10, 15, 3, 8, 6
            };

            Assert.Equal(expected, actual);
        }
Beispiel #2
0
        public void Can_Fizz_Buzz()
        {
            KAryTree <int>    testTree       = MakeFizzTree();
            FizzBuzzTree      fizzbuzz       = new FizzBuzzTree();
            KAryTree <string> fizzBuzzedTree = fizzbuzz.FizzBuzzer(testTree);
            List <string>     actual         = fizzBuzzedTree.PreOrder();
            List <string>     expected       = new List <string>()
            {
                "Fizz", "4", "7", "13", "Fizzbuzz", "Buzz", "Buzz", "Fizzbuzz", "Fizz", "8", "Fizz"
            };

            Assert.Equal(expected, actual);
            //{ 3, 4, 7, 13, 30, 5, 10, 15, 3, 8, 6 }
        }