public void DoesParkExist_Test()
        {
            bool result  = v.DoesParkExist("Acadia", connectionString);
            bool result1 = v.DoesParkExist("Arches", connectionString);
            bool result2 = v.DoesParkExist("Dingle Berry", connectionString);

            Assert.AreEqual(true, result);
            Assert.AreEqual(true, result1);
            Assert.AreEqual(false, result2);
        }
Exemple #2
0
        public static void ChooseParkMenu(List <Park> parks)
        {
            PrintTrees();
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();
            PrintMenuSingleSpaced(new[] { "Viewing All Parks..." });
            Console.WriteLine();

            List <string> menu = new List <string>();

            for (int i = 1; i <= parks.Count; i++)
            {
                menu.Add(i + ") " + parks[i - 1].Name);
            }
            PrintMenuDoubleSpaced(menu.ToArray());


            PrintMenuSingleSpaced(new[] { "Please Select a Park for More Information" });

            PrintTreesBottom();
            string userParkName = Console.ReadLine();

            Console.Clear();

            bool parkExists = parkDAL.DoesParkExist(userParkName, connectionString);

            if (parkExists)
            {
                ParkInformationScreen(userParkName);
            }
            if (userParkName == "1")
            {
                ParkInformationScreen("acadia");
            }
            if (userParkName == "2")
            {
                ParkInformationScreen("arches");
            }
            if (userParkName == "3" || userParkName.ToLower() == "cuyahoga")
            {
                ParkInformationScreen("cuyahoga valley");
            }
            else
            {
                Console.Clear();
                PrintMenuSingleSpaced(new[] { $"{userParkName} is not a valid option, please enter one of the choices below..." });
                Console.WriteLine();
                ChooseParkMenu(parks);
            }
        }