Exemple #1
0
        static void Main(string[] args)
        {
            IDrink espresso = new Espresso(new Chocolate(new Milk()));

            Console.WriteLine(espresso.GetDescription());
            Console.WriteLine(espresso.GetCost());
        }
        public void Decorator_Espresso_WithoutDesign()
        {
            var coffee = new Espresso();

            var result = coffee.GetCost();

            Assert.Equal(2.99, result);
        }
        static void Main(string[] args)
        {
            var espresso = new Espresso();

            Console.WriteLine(espresso.GetDescription() + " - $" + espresso.GetCost());

            var espressoWithMilk = new Milk(new Espresso());

            Console.WriteLine(espressoWithMilk.GetDescription() + " - $" + espressoWithMilk.GetCost());

            Console.ReadKey();
        }