Example #1
0
        public Dictionary <RecipeType, RecipeDetail> BuildRecipes()
        {
            var builder = new RecipeBuilder();

            LongswordRecipes(builder);

            return(builder.Build());
        }
        public void ExtractRecipeTest()
        {
            Recipe             rec          = PrepRecipe();
            RecipeInstructions instructions = PrepRecipeInstructions();
            NutritionList      nlist        = new NutritionList
            {
                Calories = 240,
                Fat      = 9
            };

            RecipeBuilder builder = new RecipeBuilder();
            MyRecipe      recipe  = builder.Build(rec);

            Assert.Equal("Sahil Makhija", recipe.Author);
            Assert.Equal("Dessert", recipe.Category);
            Assert.Equal(string.Empty, recipe.CookingMethod);
            Assert.Equal(TimeSpan.FromMinutes(20), recipe.CookTime);
            Assert.Equal("General", recipe.Cuisine);
            Assert.Equal("A delicious layered low carb dessert with the flavours of chocolate and coffee", recipe.Desciption);
            Assert.Equal(new List <string> {
                "LowFatDiet"
            }, recipe.Diets);
            Assert.Equal(new List <string>
            {
                "45 grams Almond Flour ( I use this one )",
                "30 grams Salted Butter",
                "1 Tbsp Unsweetened Coco Powder ( I recommend this one )",
                "150 grams Mascarpone cheese",
                "1 Tsp Vanilla Extract",
                "2 Tbsp Water",
                "1 Tsp Instant espresso powder",
                "100 ml Heavy Cream",
                "30 grams Dark Chocolate (85% or Higher) (I use Lindt 85%)",
                "Stevia to taste"
            }
                         , recipe.Ingredients);

            recipe.Instructions.Should().BeEquivalentTo(instructions);
            Assert.Equal("Keto Coffee & Chocolate Tart", recipe.Name);
            recipe.Nutrition.Should().BeEquivalentTo(nlist);
            Assert.Equal(TimeSpan.FromMinutes(10), recipe.PrepTime);
            Assert.Equal(3, recipe.Servings);
            Assert.Equal("http://www.janedoe.com/", recipe.Source);
        }