public void test_coffee() { { ICoffee coffee = new Espresso(); Chocolate decoratorChocolate = new Chocolate(coffee); decoratorChocolate.AddCondiment(); Assert.That(coffee.GetPrice() == 3.98); Milk decoratorMilk = new Milk(coffee); decoratorMilk.AddCondiment(); Assert.That(coffee.GetPrice() == 5.97); } { ICoffee coffee = new Espresso(); Chocolate decoratorChocolate = new Chocolate(coffee); decoratorChocolate.AddCondiment(); Milk decoratorMilk = new Milk(decoratorChocolate); decoratorMilk.AddCondiment(); Assert.That(coffee.GetPrice() == 5.97); } }
public void EspressotPriceTest() { //Arrange Beverage bev = new Espresso(); decimal price; //Act price = bev.GetPrice(); //Assert Assert.AreEqual(price, 1.99m); }