Пример #1
0
        public void ReturnCorrectFilterByTypes()
        {
            Entrees = Menu.Entrees();
            //Entrees = Menu.FilterByType(Entrees, CategoriesEmptyList);

            Sides = Menu.Sides();
            Sides = Menu.FilterByType(Sides, CategoriesEmptyList);

            Drinks = Menu.Drinks();
            Drinks = Menu.FilterByType(Drinks, CategoriesEmptyList);

            Assert.Contains(Menu.FilterByType(Entrees, CategoriesEmptyList), (item) => { return(item is BriarheartBurger); });
            Assert.Contains(Entrees, (item) => { return(item is DoubleDraugr); });
            Assert.Contains(Entrees, (item) => { return(item is GardenOrcOmelette); });
            Assert.Contains(Entrees, (item) => { return(item is PhillyPoacher); });
            Assert.Contains(Entrees, (item) => { return(item is SmokehouseSkeleton); });
            Assert.Contains(Entrees, (item) => { return(item is ThalmorTriple); });
            Assert.Contains(Entrees, (item) => { return(item is ThugsTBone); });

            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Small Aretino Apple Juice")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Medium Aretino Apple Juice")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Large Aretino Apple Juice")); });

            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Small Decaf Candlehearth Coffee")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Medium Decaf Candlehearth Coffee")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Large Decaf Candlehearth Coffee")); });

            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Small Candlehearth Coffee")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Medium Candlehearth Coffee")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Large Candlehearth Coffee")); });

            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Small Markarth Milk")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Medium Markarth Milk")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Large Markarth Milk")); });

            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Small Warrior Water")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Medium Warrior Water")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Large Warrior Water")); });

            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Small Cherry Sailor Soda")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Medium Cherry Sailor Soda")); });
            Assert.Contains(Drinks, (item) => { return(item.ToString().Equals("Large Cherry Sailor Soda")); });

            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Small Dragonborn Waffle Fries")); });
            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Medium Dragonborn Waffle Fries")); });
            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Large Dragonborn Waffle Fries")); });

            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Small Fried Miraak")); });
            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Medium Fried Miraak")); });
            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Large Fried Miraak")); });

            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Small Mad Otar Grits")); });
            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Medium Mad Otar Grits")); });
            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Large Mad Otar Grits")); });

            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Small Vokun Salad")); });
            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Medium Vokun Salad")); });
            Assert.Contains(Sides, (item) => { return(item.ToString().Equals("Large Vokun Salad")); });

            Entrees = Menu.FilterByType(Entrees, CategoriesNoEntrees);
            int count = Entrees.Count();

            Assert.Equal(0, count); //empty list

            Sides = Menu.FilterByType(Sides, CategoriesNoSides);
            count = Sides.Count();
            Assert.Equal(0, count); //empty list

            Drinks = Menu.FilterByType(Drinks, CategoriesNoDrinks);
            count  = Drinks.Count();
            Assert.Equal(0, count); //empty list
        }