Example #1
0
        static void Main(string[] args)
        {
            // test data

            /*MenuItem lasagna = new MenuItem("Lasagna", "Our secret recipe - delicious", "Main Course");
             * MenuItem filetMignon = new MenuItem("Filet Mignon", "Our aged beef - delicious", "Main Course");
             * MenuItem ceaserSalad = new MenuItem("Ceaser Salad", "Very fresh - delicious", "Appetizer");
             * MenuItem calamari = new MenuItem("Calamari", "Our secret sauce - delicious", "Appetizer");
             * MenuItem cheeseCake = new MenuItem("Cheese Cake", "Straight from NY - delicious", "Dessert");
             * MenuItem pieAlaMode = new MenuItem("Apple Pie a la Mode ", "Nice and hot - delicious", "Dessert"); */

            //create new menu and stroe it in variabvle titled tastys with a name of Tasty's - Friday's Specials
            Menu tastys = new Menu("Tasty's - Friday's Specials");

            //add 3 menu items to teh menu
            tastys.AddMenuItem("Lasagna", "Our secret recipe - delicious", "Main Course");
            tastys.AddMenuItem("Filet Mignon", "Our aged beef - delicious", "Main Course");
            tastys.AddMenuItem("Cheese Cake", "Straight from NY - delicious", "Dessert");

            //show the menu
            tastys.ShowMenu();
            Console.ReadLine();

            //remove a menu item and show the resulting menu
            tastys.RemoveMenuItem("Lasagna", 1);  // note we knbow the id is one - in prodcustion ShowMenuIyem will display the ID for you
            tastys.ShowMenu();
            Console.ReadLine();

            //add another menu item called cheese cake and see if it gets rejected
            //search for menu tem Cheese Cake - it should be there twice
            // and finally search for an item tyhat is not there - returns message saying menu item not found
            tastys.AddMenuItem("Cheese Cake", "Straight from NY - delicious", "Dessert");
            tastys.AddMenuItem("Cheese Cake", "Straight - NY - delicious", "Dessert");
            tastys.AddMenuItem("Cheese Cake", "Straight from NY - delicous", "Dessert");
            tastys.GetMenuItem("Cheese Cake");
            tastys.GetMenuItem("Cheese ake");

            Console.ReadLine();
            MenuItem compare1 = tastys.GetMenuItem("Filet Mignon");
            MenuItem compare2 = tastys.GetMenuItem("Cheese Cake");

            Console.WriteLine("We are here at the  compare section - hit return to execut4e teh compare commands test");
            Console.ReadLine();
            if (compare1.Equals(compare2))
            {
                Console.WriteLine(compare1.Name + " is the same as " + compare2.Name);
            }
            else
            {
                Console.WriteLine(compare1.Name + " is not the same as " + compare2.Name);
            }
            Console.ReadLine();
        }