static void Main(string[] args) { Beverage beverage1 = new Espresso(); Console.WriteLine(beverage1.GetDescription() + " $" + beverage1.Cost()); Beverage beverage2 = new DarkRoast(); beverage2 = new Mocha(beverage2); //beverage2 = new Mocha(beverage2); //beverage2 = new Whip(beverage2); Console.WriteLine(beverage2.GetDescription() + " $" + beverage2.Cost()); Beverage beverage3 = new HouseBlend(); beverage3 = new Soy(beverage3); beverage3 = new Whip(beverage3); beverage3 = new Mocha(beverage3); Console.WriteLine(beverage3.GetDescription() + " $" + beverage3.Cost()); Beverage beverage4 = new DarkRoast(); beverage4.Size = BeverageSizeEnum.VENTI; beverage4 = new Mocha(beverage4); //beverage4 = new Mocha(beverage4); //beverage4 = new Whip(beverage4); Console.WriteLine(beverage4.GetDescription() + " $" + beverage4.Cost()); Console.ReadLine(); }
public void TestEspresso() { Beverage.Decorator.Beverage beverage = new Espresso(); Assert.AreEqual("Espresso $1,99", beverage.GetDescription() + " $" + beverage.Cost(), "TestEspresso failed"); }