/// <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()); }
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); } }
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); } }
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); } }
/// <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); }
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); }
/// <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); }
/// <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); }
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); }
/// <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); }