Exemple #1
0
        public string GetDrink(string drinkType)
        {
            HotDrinkMachine hotDrinkMachine = new HotDrinkMachine();

            buildDrinkPrepare += "<div class='css-drinkProgress blink_me'>You drink is being prepared</div>";;
            switch (drinkType.ToUpper())
            {
            case "COFFEE":
                Coffee coffee = new Coffee();
                if (hotDrinkMachine.PrepareHotDrink(coffee) != null && hotDrinkMachine.PrepareHotDrink(coffee).Count > 0)
                {
                    buildDrinkPrepare  = "<div id='1' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(coffee)[0].BoilWater + "</label></div>";
                    buildDrinkPrepare += "<div id='2' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(coffee)[0].BrewCoffeeGrounds + "</label></div>";
                    buildDrinkPrepare += "<div id='3' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(coffee)[0].PourCoffeeInCup + "</label></div>";
                    buildDrinkPrepare += "<div id='4' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(coffee)[0].AddSugarAndMilk + "</label></div>";
                }
                break;

            case "LEMONTEA":
                LemonTea lemontea = new LemonTea();
                if (hotDrinkMachine.PrepareHotDrink(lemontea) != null && hotDrinkMachine.PrepareHotDrink(lemontea).Count > 0)
                {
                    buildDrinkPrepare  = "<div id='1' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(lemontea)[0].BoilWater + "</label></div>";
                    buildDrinkPrepare += "<div id='2' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(lemontea)[0].SteepWaterInTea + "</label></div>";
                    buildDrinkPrepare += "<div id='3' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(lemontea)[0].PourTeaInCup + "</label></div>";
                    buildDrinkPrepare += "<div id='4' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(lemontea)[0].AddLemon + "</label></div>";
                }
                break;

            case "CHOCOLATE":
                Chocolate chocolate = new Chocolate();
                if (hotDrinkMachine.PrepareHotDrink(chocolate) != null && hotDrinkMachine.PrepareHotDrink(chocolate).Count > 0)
                {
                    buildDrinkPrepare  = "<div id='1' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(chocolate)[0].BoilWater + "</label></div>";
                    buildDrinkPrepare += "<div id='2' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(chocolate)[0].AddChocPowderInWater + "</label></div>";
                    buildDrinkPrepare += "<div id='3' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(chocolate)[0].PourChocolateInTheCup + "</label></div>";
                }
                break;

            case "ROOHAFZA":
                RoohAfza roohAfza = new RoohAfza();
                if (hotDrinkMachine.PrepareHotDrink(roohAfza) != null && hotDrinkMachine.PrepareHotDrink(roohAfza).Count > 0)
                {
                    buildDrinkPrepare  = "<div id='1' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(roohAfza)[0].PourWaterInGlass + "</label></div>";
                    buildDrinkPrepare += "<div id='2' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(roohAfza)[0].PourRoofAfza + "</label></div>";
                    buildDrinkPrepare += "<div id='3' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(roohAfza)[0].AddIceCubes + "</label></div>";
                    buildDrinkPrepare += "<div id='4' class='css-drinkProgress '><label class='blink_me'>" + hotDrinkMachine.PrepareHotDrink(roohAfza)[0].StirItWell + "</label></div>";
                }
                break;

            default: return("<div class='css-drinkProgress blink_me'>No Drink Found</div>");
            }
            return(buildDrinkPrepare += "<div id='ready' class='css-drinkProgress css-drinkProgress-drinkready' onclick='fn_drinkReady()'>You drink is Ready - Please Cick Here to Remove Your Drink</div>");
        }
Exemple #2
0
        public IActionResult Index()
        {
            Coffee          drink           = new Coffee();
            HotDrinkMachine hotDrinkMachine = new HotDrinkMachine();

            // Act
            var result = hotDrinkMachine.PrepareHotDrink(drink);

            return(View(result));
        }
Exemple #3
0
        public void PrepareDrink_Chocolate()
        {
            // Arrange
            Chocolate       drink           = new Chocolate();
            HotDrinkMachine hotDrinkMachine = new HotDrinkMachine();

            // Act
            var result = hotDrinkMachine.PrepareHotDrink(drink);

            // Assert
            Assert.NotNull(result.Where(x => x.BoilWater == "Boiling water."));
            Assert.NotNull(result.Where(x => x.AddChocPowderInWater == "Adding chocolate powder to the water"));
            Assert.NotNull(result.Where(x => x.PourChocolateInTheCup == "Pouring chocolate in the cup"));
        }
Exemple #4
0
        public void PrepareDrink_Tea()
        {
            // Arrange
            LemonTea        drink           = new LemonTea();
            HotDrinkMachine hotDrinkMachine = new HotDrinkMachine();

            // Act
            var result = hotDrinkMachine.PrepareHotDrink(drink);

            // Assert
            Assert.NotNull(result.Where(x => x.BoilWater == "Boiling water"));
            Assert.NotNull(result.Where(x => x.SteepWaterInTea == "Steeping water in the tea"));
            Assert.NotNull(result.Where(x => x.PourTeaInCup == "Pouring tea in the cup"));
            Assert.NotNull(result.Where(x => x.AddLemon == "Adding lemon"));
        }
Exemple #5
0
        public void PrepareDrink_Coffee()
        {
            // Arrange
            Coffee          drink           = new Coffee();
            HotDrinkMachine hotDrinkMachine = new HotDrinkMachine();


            // Act
            var result = hotDrinkMachine.PrepareHotDrink(drink);

            // Assert
            Assert.NotNull(result.Where(x => x.BoilWater == "Boiling water"));
            Assert.NotNull(result.Where(x => x.BrewCoffeeGrounds == "Brewing the coffee grounds"));
            Assert.NotNull(result.Where(x => x.PourCoffeeInCup == "Pouring coffee in the cup"));
        }