public void TestMethod()
    {
        Drink drink = new Espresso();

        System.Diagnostics.Debug.WriteLine(drink.Description);
        drink = new SecretIngredient(drink);
        System.Diagnostics.Debug.WriteLine(drink.Description);
    }
Beispiel #2
0
        static void Main(string[] args)
        {
            Drink drink = new Espresso()
            {
                Description = "Expresso"
            };

            Console.WriteLine(drink.Description);

            drink = new SecretIngredient(drink);
            Console.WriteLine(drink.Description);

            drink = new Ice(drink);
            Console.WriteLine(drink.Description);

            Console.ReadKey();
        }