public void TestDarkRoastWithSize()
 {
     Beverage.Decorator.Beverage beverage = new DarkRoast();
     beverage.Size = BeverageSizeEnum.VENTI;
     beverage = new Mocha(beverage);
     Assert.AreEqual("Dark Roast Coffee (VENTI), Mocha $1,55", beverage.GetDescription() + " $" + beverage.Cost());
 }
예제 #2
0
        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 TestDarkRoast()
 {
     Beverage.Decorator.Beverage beverage = new DarkRoast();
     beverage = new Mocha(beverage);
     Assert.AreEqual("Dark Roast Coffee (), Mocha $1,3", beverage.GetDescription() + " $" + beverage.Cost());
 }