Exemplo n.º 1
0
        public void GivenAddOneSugarShouldHaveOneSugarPlusStick()
        {
            // Arrange
            _drinkBuilder.SelectDrink(new Coffee());
            _drinkBuilder.AddSugar();

            // Act
            var result = _drinkBuilder.GetOrder();

            // Assert
            Assert.Equal("C:1:0", result);
        }
Exemplo n.º 2
0
        public void GivenChocolateSelectionWithOneSugarShouldGenerateMessageToUI()
        {
            // Arrange
            _drinkBuilder.SelectDrink(new Chocolate());
            _drinkBuilder.AddSugar();
            _drinkBuilder.InsertMoney(0.5);

            // Act
            string result = _drinkBuilder.SendMessageToUi();

            // Assert
            Assert.Equal("M:Drink maker makes 1 chocolate with 1 sugar and a stick", result);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Создание напитка
 /// </summary>
 /// <param name="drinkBuilder">Строитель напитка(тип напитка)</param>
 /// <param name="nameDrink">Наименование напитка</param>
 /// <param name="qSugar">Количество едениц сахара</param>
 /// <param name="addMilk">Наличие молока</param>
 /// <param name="addSyrup">Наличие сиропа</param>
 /// <param name="addCappuccinoFoam">Наличие молочной пенки</param>
 /// <returns>Напиток(Drink)</returns>
 public Drink CreateDrink(DrinkBuilder drinkBuilder, string nameDrink, int qSugar, bool addMilk, bool addSyrup, bool addCappuccinoFoam)
 {
     drinkBuilder.CreateDrink(nameDrink);
     drinkBuilder.AddCoffee();
     drinkBuilder.AddTea();
     drinkBuilder.AddWater();
     drinkBuilder.AddMilk(addMilk);
     drinkBuilder.AddSyrup(addSyrup);
     drinkBuilder.AddSugar(qSugar);
     drinkBuilder.AddCappuccinoFoam(addCappuccinoFoam);
     return(drinkBuilder.Drink);
 }