Example #1
0
 public Drink(DrinkTypes type, int price, int needCoffee, int needMilk, int needWater, int needSugar)
 {
     Type       = type;
     Price      = price;
     NeedCoffee = needCoffee;
     NeedMilk   = needMilk;
     NeedWater  = needWater;
     NeedSugar  = needSugar;
 }
Example #2
0
        public TrackedDayRecordViewModel()
        {
            DrinkTypes = Mapper.Map <ObservableCollection <DrinkTypeViewModel> >(DrinkTypesService.GetAll());
            DrinkType  = DrinkTypes.FirstOrDefault();

            Time = DateTime.Now.TimeOfDay;

            Volume = _step;

            DecreasePortionCommand = new Command(DecreasePortion);
            IncreasePortionCommand = new Command(IncreasePortion);
        }
Example #3
0
        public string AddExtras(DrinkTypes type)
        {
            if (type == DrinkTypes.Tea)
            {
                //the actions for steep the water in the tea

                return("Add lemon");
            }
            else if (type == DrinkTypes.Coffee)
            {
                //the actions to brew the coffee ground

                return("Add sugar and milk");
            }

            return(string.Empty);
        }
        public ActionResult Select(DrinkTypes type)
        {
            var drink = new DrinkMaker();

            var messages = new List <string>();

            messages.Add(drink.BoilWater());
            messages.Add(drink.AddPowder(type));
            messages.Add(drink.PourDrink(type));
            messages.Add(drink.AddExtras(type));

            var hotDrink = new HotDrink();

            hotDrink.Label    = type.ToString();
            hotDrink.Messages = messages;

            return(View(hotDrink));
        }
Example #5
0
        public Drink this[DrinkTypes drinkType]
        {
            get
            {
                if (drinkList is null)
                {
                    throw new ArgumentException("No drink recipes added!");
                }

                foreach (var drinkItem in drinkList)
                {
                    if (drinkType == drinkItem.Type)
                    {
                        return(drinkItem);
                    }
                }

                throw new ArgumentException("Invalid drink type!");
            }
        }
Example #6
0
        public string AddPowder(DrinkTypes type)
        {
            if (type == DrinkTypes.Tea)
            {
                //the action for steep the water in the tea

                return("Steep the water in the tea");
            }
            else if (type == DrinkTypes.Coffee)
            {
                //the actions to brew the coffee ground
                return("Brew the coffee ground");
            }
            else if (type == DrinkTypes.Chocolate)
            {
                //the actions for adding drinking chocolate powder to the water

                return("Add drinking chocolate powder to the water");
            }

            return(string.Empty);
        }
Example #7
0
 public void AddDrink(DrinkTypes type, int price, int needCoffee, int needMilk, int needWater, int needSugar)
 {
     drinkList.Add(new Drink(type, price, needCoffee, needMilk, needWater, needSugar));
 }
 public IMealItem GetDrink(DrinkTypes type)
 {
     // could be: go to the refrigerator and take a drink ...
     return new Drink(type, PriceList.GetDrinkPrice(type));
 }
Example #9
0
 public Drink(DrinkTypes type, decimal price)
     : base(price)
 {
     Type = type;
 }
Example #10
0
 public decimal GetDrinkPrice(DrinkTypes type)
 {
     return(_drinksPriceList[type]);
 }
Example #11
0
 public Order(BurgerTypes burgerType, DrinkTypes drinkType, ToyTypes toyType)
 {
     BurgerType = burgerType;
     DrinkType  = drinkType;
     ToyType    = toyType;
 }
        public void GetDrink_returns_burger_having_specified_type(DrinkTypes type)
        {
            var drink = (Drink)_operations.GetDrink(type);

            Assert.AreEqual(type, drink.Type);
        }
Example #13
0
        public string PourDrink(DrinkTypes type)
        {
            //the actions for pouring the drink

            return("Pour " + type.ToString() + " in the cup");
        }
Example #14
0
 public IMealItem GetDrink(DrinkTypes type)
 {
     // could be: go to the refrigerator and take a drink ...
     return(new Drink(type, PriceList.GetDrinkPrice(type)));
 }
 public Drink(string name, int quantity, decimal taxPercent, DrinkTypes drinkTypes)
     : base(name, quantity, taxPercent)
 {
     TypesOfDrink = drinkTypes;
 }
        public ActionResult Index()
        {
            var types = new DrinkTypes();

            return(View(types));
        }
        public void GetDrink_returns_burger_having_price_from_PriceList(DrinkTypes type)
        {
            _operations.GetDrink(type);

            _mockPriceList.Verify(x => x.GetDrinkPrice(type), Times.Once());
        }
Example #18
0
 public Order(BurgerTypes burgerType, DrinkTypes drinkType, ToyTypes toyType)
 {
     BurgerType = burgerType;
     DrinkType = drinkType;
     ToyType = toyType;
 }
 public decimal GetDrinkPrice(DrinkTypes type)
 {
     return _drinksPriceList[type];
 }
        public void GetDrink_returns_burger_having_specified_type(DrinkTypes type)
        {
            var drink = (Drink)_operations.GetDrink(type);

            Assert.AreEqual(type, drink.Type);
        }
        public void GetDrink_returns_burger_having_price_from_PriceList(DrinkTypes type)
        {
            _operations.GetDrink(type);

            _mockPriceList.Verify(x => x.GetDrinkPrice(type), Times.Once());
        }
Example #22
0
 public Drink(DrinkTypes type, decimal price)
     : base(price)
 {
     Type = type;
 }