Exemplo n.º 1
0
        public void RecipeFinderResults_ShouldCallContextRecipeSearch()
        {
            var testQuery    = new RecipeQuery();
            var recipeFinder = new RecipeFinder(this.Context, testQuery);

            this.Context.RSCalledTimes = 0;

            var search = recipeFinder.Results();

            var query = this.Context.search;

            Assert.AreEqual(1, this.Context.RSCalledTimes);

            CollectionAssert.AreEqual(query.Include, new Guid[0]);
            CollectionAssert.AreEqual(query.Exclude, new Guid[0]);
            Assert.AreEqual(query.Keywords, null);
            Assert.AreEqual(query.Meal, MealFilter.All);
            Assert.AreEqual(query.Photos, PhotoFilter.All);
            Assert.AreEqual(query.Rating, Rating.None);
            Assert.AreEqual(SortOrder.Rating, query.Sort);
            Assert.AreEqual(SortDirection.Descending, query.Direction);

            Assert.AreEqual(query.Time, new TimeFilter());
            Assert.AreEqual(query.Diet, new DietFilter());
            Assert.AreEqual(query.Nutrition, new NutritionFilter());
            Assert.AreEqual(query.Skill, new SkillFilter());
            Assert.AreEqual(query.Taste, new TasteFilter());
        }
Exemplo n.º 2
0
        public void RecipeFinderResults_ShouldCallContextRecipeSearch()
        {
            var testQuery = new RecipeQuery();
            var recipeFinder = new RecipeFinder(this.Context, testQuery);

            this.Context.RSCalledTimes = 0;

            var search = recipeFinder.Results();

            var query = this.Context.search;
            Assert.AreEqual(1, this.Context.RSCalledTimes);

            CollectionAssert.AreEqual(query.Include, new Guid[0]);
            CollectionAssert.AreEqual(query.Exclude, new Guid[0]);
            Assert.AreEqual(query.Keywords, null);
            Assert.AreEqual(query.Meal, MealFilter.All);
            Assert.AreEqual(query.Photos, PhotoFilter.All);
            Assert.AreEqual(query.Rating, Rating.None);
            Assert.AreEqual(SortOrder.Rating, query.Sort);
            Assert.AreEqual(SortDirection.Descending, query.Direction);

            Assert.AreEqual(query.Time, new TimeFilter());
            Assert.AreEqual(query.Diet, new DietFilter());
            Assert.AreEqual(query.Nutrition, new NutritionFilter());
            Assert.AreEqual(query.Skill, new SkillFilter());
            Assert.AreEqual(query.Taste, new TasteFilter());
        }