Esempio n. 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;
 }
Esempio n. 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);
        }
Esempio n. 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));
        }
Esempio n. 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!");
            }
        }
Esempio n. 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);
        }
Esempio n. 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));
 }
Esempio n. 9
0
 public Drink(DrinkTypes type, decimal price)
     : base(price)
 {
     Type = type;
 }
Esempio n. 10
0
 public decimal GetDrinkPrice(DrinkTypes type)
 {
     return(_drinksPriceList[type]);
 }
Esempio n. 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);
        }
Esempio n. 13
0
        public string PourDrink(DrinkTypes type)
        {
            //the actions for pouring the drink

            return("Pour " + type.ToString() + " in the cup");
        }
Esempio n. 14
0
 public IMealItem GetDrink(DrinkTypes type)
 {
     // could be: go to the refrigerator and take a drink ...
     return(new Drink(type, PriceList.GetDrinkPrice(type)));
 }
Esempio n. 15
0
 public Drink(string name, int quantity, decimal taxPercent, DrinkTypes drinkTypes)
     : base(name, quantity, taxPercent)
 {
     TypesOfDrink = drinkTypes;
 }
Esempio n. 16
0
        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());
        }
Esempio n. 18
0
 public Order(BurgerTypes burgerType, DrinkTypes drinkType, ToyTypes toyType)
 {
     BurgerType = burgerType;
     DrinkType = drinkType;
     ToyType = toyType;
 }
Esempio n. 19
0
 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());
        }
Esempio n. 22
0
 public Drink(DrinkTypes type, decimal price)
     : base(price)
 {
     Type = type;
 }