Ejemplo n.º 1
0
        public void GetIngredientsByWrongCategoryIdTest()
        {
            var categoryId = Guid.NewGuid();

            var result = QueryFunctions.IngredientsByCategoryIdFunction(CocktailsContext.Ingredients, categoryId).ToArray();

            Assert.AreEqual(0, result.Length);
        }
Ejemplo n.º 2
0
        public void GetIngredientsByCategoryIdTest()
        {
            var rnd        = new Random();
            var index      = rnd.Next(CocktailsContext.Ingredients.Count() - 1);
            var item       = CocktailsContext.Ingredients.ToArray()[index];
            var categoryId = item.CategoryId;

            var result = QueryFunctions.IngredientsByCategoryIdFunction(CocktailsContext.Ingredients, categoryId).ToArray();

            Assert.AreEqual(1, result.Length);
            Assert.Contains(item, result);
        }