Example #1
0
        /// <summary>
        /// lisof the complete menu
        /// </summary>
        /// <returns>List of the complete menu</returns>
        public static IEnumerable <IOrderItem> CompleteMenu()
        {
            List <IOrderItem> items = new List <IOrderItem>();

            IEnumerable <IOrderItem> Entrees = Menu.Entrees();

            foreach (IOrderItem item in Entrees)
            {
                items.Add(item);
            }

            IEnumerable <IOrderItem> Sides = Menu.Sides();

            foreach (IOrderItem item in Sides)
            {
                items.Add(item);
            }

            IEnumerable <IOrderItem> Drinks = Menu.Drinks();

            foreach (IOrderItem item in Drinks)
            {
                items.Add(item);
            }

            return(items.ToArray());
        }
Example #2
0
        public void VerifyingDrinksAreInDrinks()
        {
            var drinks = CCMenu.Sides();
            var Drinks = new List <string>();

            foreach (IOrderItem item in drinks)
            {
                Drinks.Add(drinks.ToString());
            }

            var items = new List <IOrderItem>
            {
                new CowboyCoffee(),
                new JerkedSoda(),
                new TexasTea(),
                new Water()
            };
            var Items = new List <string>();

            foreach (IOrderItem item in items)
            {
                Items.Add(items.ToString());
            }

            foreach (string item in Items)
            {
                Assert.Contains(item, Drinks);
            }
        }
Example #3
0
        public void VerifyingSidesAreInSides()
        {
            var sides = CCMenu.Sides();
            var Sides = new List <string>();

            foreach (IOrderItem item in sides)
            {
                Sides.Add(sides.ToString());
            }

            var items = new List <IOrderItem>
            {
                new BakedBeans(),
                new ChiliCheeseFries(),
                new CornDodgers(),
                new PanDeCampo()
            };
            var Items = new List <string>();

            foreach (IOrderItem item in items)
            {
                Items.Add(items.ToString());
            }

            foreach (string item in Items)
            {
                Assert.Contains(item, Sides);
            }
        }
Example #4
0
        public void VerifyingEntreeSideCategoryFilter()
        {
            var filters = new List <string>
            {
                "Entree",
                "Side"
            };
            var menu    = CCMenu.All();
            var results = CCMenu.FilterByCategory(menu, filters);
            var Results = new List <string>();

            foreach (IOrderItem item in results)
            {
                Results.Add(item.ToString());
            }

            var entrees = CCMenu.Entrees();
            var sides   = CCMenu.Sides();
            var items   = new List <IOrderItem>();

            items.AddRange(entrees);
            items.AddRange(sides);
            var Items = new List <string>();

            foreach (IOrderItem item in items)
            {
                Items.Add(item.ToString());
            }

            foreach (string item in Items)
            {
                Assert.Contains(item, Results);
            }
        }
Example #5
0
        /// <summary>
        /// returns all menu items
        /// </summary>
        /// <returns></returns>
        public static IEnumerable <IOrderItem> CompleteMenu()
        {
            var drinks  = Menu.Drinks();
            var entrees = Menu.Entrees();
            var sides   = Menu.Sides();

            var complete = entrees.Concat(sides).Concat(drinks);

            return(complete);
        }
Example #6
0
 static List <IOrderItem> MenuDatabase()
 {
     foreach (Entree item in Menu.Entrees())
     {
         menuItems.Add(item);
     }
     foreach (Side item in Menu.Sides())
     {
         menuItems.Add(item);
     }
     foreach (Drink item in Menu.Drinks())
     {
         menuItems.Add(item);
     }
     return(menuItems);
 }
Example #7
0
        /// <summary>
        /// Static class returning a list of the complete menu.
        /// </summary>
        /// <returns>A list of the complete menu.</returns>
        public static IEnumerable <IOrderItem> CompleteMenu()
        {
            List <IOrderItem> menu = new List <IOrderItem>();

            foreach (IOrderItem item in Menu.Entrees())
            {
                menu.Add(item);
            }
            foreach (IOrderItem item in Menu.Sides())
            {
                menu.Add(item);
            }
            foreach (IOrderItem item in Menu.Drinks())
            {
                menu.Add(item);
            }
            return(menu);
        }
Example #8
0
        /// <summary>
        /// A list containing single instances of all menu items
        /// </summary>
        /// <returns></returns>
        public static IEnumerable <IOrderItem> All()
        {
            List <IOrderItem> complete = new List <IOrderItem>();

            foreach (IOrderItem item in Menu.Entrees())
            {
                complete.Add(item);
            }
            foreach (IOrderItem item in Menu.Sides())
            {
                complete.Add(item);
            }
            foreach (IOrderItem item in Menu.Drinks())
            {
                complete.Add(item);
            }
            return(complete);
        }
Example #9
0
        public static IEnumerable <IOrderItem> CompleteMenu()
        {
            List <IOrderItem> items = new List <IOrderItem>();

            foreach (Entree e in Menu.Entrees())
            {
                items.Add(e);
            }
            foreach (Side s in Menu.Sides())
            {
                items.Add(s);
            }
            foreach (Drink d in Menu.Drinks())
            {
                items.Add(d);
            }
            IEnumerable <IOrderItem> i = items;

            return(i);
        }
Example #10
0
        /// <summary>
        /// Filter by item type
        /// </summary>
        /// <param name="items"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static IEnumerable <IOrderItem> FilterByType(IEnumerable <IOrderItem> items, string[] type)
        {
            if (type == null)
            {
                return(items);
            }

            if (type.Contains("Side"))
            {
                items.Concat(Menu.Sides());
            }

            if (type.Contains("Entree"))
            {
                items.Concat(Menu.Sides());
            }

            if (type.Contains("Drink"))
            {
                items.Concat(Menu.Drinks());
            }
            return(items);
        }