Exemple #1
0
        public void RecipeQuery_Get_All_Succeeds()
        {
            var recipes = new RecipeQuery(_mockRepository.Object)
                          .Get();

            Assert.AreEqual(100, recipes.Count());
            Assert.IsTrue(recipes.All(r => r.Id >= 1 && r.Id <= 100));
        }
Exemple #2
0
        public void RecipeQuery_Get_Where_Succeeds()
        {
            var recipes = new RecipeQuery(_mockRepository.Object)
                          .GetWhere(new RecipeQueryOptions
            {
                TitleContains = "50"
            });

            Assert.IsNotNull(recipes);
            Assert.AreEqual(1, recipes.Count());

            var recipe = recipes.Single();

            Assert.AreEqual(50, recipe.Id);
            Assert.AreEqual(50, recipe.TimeToPrepare);
        }