Exemplo n.º 1
0
        public string AddDrink(string type, string name, int servingSize, string brand)
        {
            IDrink drink = drinkFactory.Create(type, name, servingSize, brand);

            this.drinks.Add(drink);
            return($"Added {name} ({brand}) to the drink pool");
        }
Exemplo n.º 2
0
        public string AddDrink(string type, string name, int servingSize, string brand)
        {
            IDrink drink = DrinkFactory.Create(type, name, servingSize, brand);

            if (drink != null)
            {
                drinks.Add(drink);
                return($"Added {drink.Name} ({drink.Brand}) to the drink pool");
            }

            return(string.Empty);
        }