Exemplo n.º 1
0
        public void GivenChocolateSelectionShouldGenerateMessageToUI()
        {
            // Arrange
            _drinkBuilder.SelectDrink(new Chocolate());
            _drinkBuilder.InsertMoney(0.5);

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

            // Assert
            Assert.Equal("M:Drink maker makes 1 chocolate with no sugar and therefore no stick", result);
        }
Exemplo n.º 2
0
        public void GivenBadAmountForChocolateShouldGetMissingAMountMessage()
        {
            // Arrange
            var drinkBuilder = new DrinkBuilder(new SugarService(), new MoneyAmountService());

            drinkBuilder.SelectDrink(new Chocolate());
            drinkBuilder.InsertMoney(0.3);

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

            // Assert
            Assert.False(drinkBuilder.IsAmountIsEnough);
            Assert.Equal("0,2€ missing", result);
        }