public void AddChocolate() { Chocolate milkaChocolate = new ChocolateBuilder() .SetChocolateType(ChocolateType.Milk) .SetName("Spartak") .SetManufacturerName("Spartak") .SetNutritionalValue(10, 20, 30) .SetPricePerKilogram(100) .SetStartDate(new DateTime(2020, 3, 4)) .SetSugarContent(50) .SetWeight(200) .Build(); Gift.Add(milkaChocolate); }
private static HotDrinkBuilder GetBuilderForSelectedHotDrink(string selectedDrink) { HotDrinkBuilder builder = null; if (selectedDrink == DrinksNames.LemonTea) { builder = new LemonTeaBuilder(); } else if (selectedDrink == DrinksNames.Coffee) { builder = new CoffeeBuilder(); } else if (selectedDrink == DrinksNames.Chocolate) { builder = new ChocolateBuilder(); } return(builder); }