public void TestMethod() { Drink drink = new Espresso(); System.Diagnostics.Debug.WriteLine(drink.Description); drink = new SecretIngredient(drink); System.Diagnostics.Debug.WriteLine(drink.Description); }
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(); }