コード例 #1
0
        public void CreateMealPlan_FirstMeal_IsRandomRecipeFromCookBook()
        {
            var cookbook = new StubCookBook();

            var plan = MealPlan.Create(new StubCookBook());

            cookbook.GetAllRecipes().Any(x => x.Name == plan.Meals.First().Recipe.Name).ShouldBeTrue();
        }
コード例 #2
0
        public void CreateMealPlan_WherePossible_MealsArentDuplicatedInAPlan()
        {
            const int mealsToPlan = 3;

            var cookbook = new StubCookBook();
            var plan     = MealPlan.Create(cookbook, mealsToPlan);

            //First assertion is to check that we have enough stub data to allow the test to succeed.
            cookbook.GetAllRecipes().Count.ShouldBeGreaterThanOrEqualTo(mealsToPlan);

            plan.Meals.DistinctBy(x => x.Recipe.Name).Count().ShouldEqual(plan.Meals.Count);
        }
コード例 #3
0
        public void CreateMealPlan_ReturnsMealPlanWithListOfMeals()
        {
            var result = MealPlan.Create(new StubCookBook());

            result.Meals.ShouldNotBeEmpty();
        }
コード例 #4
0
        public void CreateMealPlan_ReturnsMealPlanWithNumberOfMealsSpecified()
        {
            var result = MealPlan.Create(new StubCookBook(), 10);

            result.Meals.Count.ShouldEqual(10);
        }
コード例 #5
0
        public void CreateMealPlan_ReturnsANewMealPlan()
        {
            var result = MealPlan.Create(new StubCookBook());

            result.GetType().ShouldEqual(typeof(MealPlan));
        }