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);
        }
        public void FromEmptyKitchenGetPossibleMeals()
        {
            KitchenWorker currentKitchen = new KitchenWorker();
            List <string> result         = currentKitchen.PossibleMeals();

            Assert.AreEqual(true, result != null);
            Assert.AreEqual(0, result.Count);
        }
        public void ToKitchenAddRecipeWithoutIngredientsAndQuantity()
        {
            KitchenWorker currentKitchen = new KitchenWorker();
            Recipe        newRecipe      = new Recipe();

            newRecipe.Name = "PyttIPanna";

            Assert.AreEqual(false, currentKitchen.AddRecipe(newRecipe));
        }
        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));
        }
        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);
        }
        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);
        }
        public void ToKitchenAddRecipe()
        {
            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);
            Recipe result = currentKitchen.GetRecipe(newRecipe.Name);

            Assert.AreEqual(newRecipe.Name, result.Name);
        }
 public Order(KitchenWorker receiver)
 {
     this.receiver = receiver;
 }
 public SnackOrder(KitchenWorker receiver) : base(receiver)
 {
     base.name = "snackOrder";
 }
 public DrinkOrder(KitchenWorker receiver) : base(receiver)
 {
     base.name = "drinkOrder";
 }
Exemple #11
0
 public DishOrder(KitchenWorker receiver) : base(receiver)
 {
     base.name = "熱炒訂單";
 }
 public KitchenController()
 {
     _kitchenWorker = new KitchenWorker();
 }