public void GivenChocolateSelectionShouldGenerateChocolateOrder() { // Arrange _drinkBuilder.SelectDrink(new Chocolate()); // Act string result = _drinkBuilder.GetOrder(); // Assert Assert.Equal("H::", result); }
public void GivenAddOneSugarShouldHaveOneSugarPlusStick() { // Arrange _drinkBuilder.SelectDrink(new Coffee()); _drinkBuilder.AddSugar(); // Act var result = _drinkBuilder.GetOrder(); // Assert Assert.Equal("C:1:0", result); }
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); }
public void GivenBadAmountForChocolateShouldIndicateAmountIsInsufficient() { // Arrange var drinkBuilder = new DrinkBuilder(new SugarService(), new MoneyAmountService()); drinkBuilder.SelectDrink(new Chocolate()); drinkBuilder.InsertMoney(0.3); // Act bool result = drinkBuilder.IsAmountIsEnough; // Assert Assert.False(result); }
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); }