Esempio n. 1
0
        public void Integration_FromKitchenWithAvailabileMealPrepareOrder()
        {
            KitchenWorker currentKitchen = new KitchenWorker();

            Recipe newRecipe = new Recipe();

            newRecipe.Name      = "SausageStroganoff";
            newRecipe.Available = true;
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Sausage", 1));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Cream", 2.5));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Tomato puree", 2));
            currentKitchen.AddRecipe(newRecipe);

            newRecipe           = new Recipe();
            newRecipe.Name      = "VeggieStroganoff";
            newRecipe.Available = true;
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("VeggieSausage", 1));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Cream", 2.5));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Tomato puree", 2));
            currentKitchen.AddRecipe(newRecipe);

            List <OrderItem> newOrder = new List <OrderItem>();

            newOrder.Add(new OrderItem("SausageStroganoff", 2));
            newOrder.Add(new OrderItem("VeggieStroganoff", 1));

            currentKitchen.PrepareOrder(newOrder);

            Assert.AreEqual(false, true);
        }
Esempio n. 2
0
        public void ToKitchenAddRecipeWithoutIngredientsAndQuantity()
        {
            KitchenWorker currentKitchen = new KitchenWorker();
            Recipe        newRecipe      = new Recipe();

            newRecipe.Name = "PyttIPanna";

            Assert.AreEqual(false, currentKitchen.AddRecipe(newRecipe));
        }
Esempio n. 3
0
        public void ToKitchenAddRecipeWithoutName()
        {
            KitchenWorker currentKitchen = new KitchenWorker();
            Recipe        newRecipe      = new Recipe();

            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Sausage", 1));

            Assert.AreEqual(false, currentKitchen.AddRecipe(newRecipe));
        }
Esempio n. 4
0
        public void FromKitchenGetRecipeSimilarName()
        {
            KitchenWorker currentKitchen = new KitchenWorker();
            Recipe        newRecipe      = new Recipe();

            newRecipe.Name = "SausageStroganoffVeggie";
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("VeggieSausage", 1));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Cream", 2.5));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Tomato puree", 2));
            currentKitchen.AddRecipe(newRecipe);

            newRecipe = new Recipe();

            newRecipe.Name = "SausageStroganoff";
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Sausage", 1));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Cream", 2.5));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Tomato puree", 2));
            currentKitchen.AddRecipe(newRecipe);

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

            Assert.AreEqual(newRecipe.Name, result.Name);
        }
Esempio n. 5
0
        public void FromKitchenWithoutAvailabileMealsGetPossibleMeals()
        {
            KitchenWorker currentKitchen = new KitchenWorker();

            Recipe newRecipe = new Recipe();

            newRecipe.Name = "SausageStroganoffVeggie";
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("VeggieSausage", 1));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Cream", 2.5));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Tomato puree", 2));
            currentKitchen.AddRecipe(newRecipe);

            List <string> result = currentKitchen.PossibleMeals();

            Assert.AreEqual(true, result != null);
            Assert.AreEqual(0, result.Count);
        }
Esempio n. 6
0
        public void FromKitchenWithNotAvailabileMealPrepareMeal()
        {
            KitchenWorker currentKitchen = new KitchenWorker();

            Recipe newRecipe = new Recipe();

            newRecipe.Name      = "SausageStroganoff";
            newRecipe.Available = false;
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Sausage", 1));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Cream", 2.5));
            newRecipe.IngredientsAndQuantity.Add(new KeyValuePair <string, double>("Tomato puree", 2));
            currentKitchen.AddRecipe(newRecipe);

            Boolean result = currentKitchen.PrepareMeal("SausageStroganoff", 1);

            Assert.AreEqual(false, result);
        }