예제 #1
0
            public void GetRecipeSimilarName()
            {
                KitchenService currentKitchen = new KitchenService();

                Recipe newRecipe = new Recipe {
                    Name = "SausageStroganoffVeggie"
                };

                newRecipe.IngredientInfos.Add(new IngredientInfo {
                    Name = "VeggieSausage", Quantity = 1
                });
                newRecipe.IngredientInfos.Add(new IngredientInfo {
                    Name = "Cream", Quantity = 2.5
                });
                newRecipe.IngredientInfos.Add(new IngredientInfo {
                    Name = "Tomato puree", Quantity = 2
                });
                currentKitchen.AddRecipe(newRecipe);

                newRecipe = new Recipe {
                    Name = "SausageStroganoff"
                };
                newRecipe.IngredientInfos.Add(new IngredientInfo {
                    Name = "Sausage", Quantity = 1
                });
                newRecipe.IngredientInfos.Add(new IngredientInfo {
                    Name = "Cream", Quantity = 2.5
                });
                newRecipe.IngredientInfos.Add(new IngredientInfo {
                    Name = "Tomato puree", Quantity = 2
                });
                currentKitchen.AddRecipe(newRecipe);

                Recipe result = currentKitchen.GetRecipe("SausageStroganoff");

                Assert.AreEqual(newRecipe.Name, result.Name);
            }