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();
        }
        static void Main(string[] args)
        {
            Title.UpperIndent(Assembly.GetExecutingAssembly());

            Beverage beverage1 = new Coffee("Simple coffee", 20, Size.Small);
            Beverage beverage2 = new Milk("Milk", 4, beverage1);
            Beverage beverage3 = new Milk("Milk", 4, beverage2);

            Console.WriteLine(beverage3.GetCost());
            Console.WriteLine(beverage3.GetDescription());

            Title.BottonIndent();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            ICoffee coffee = new Coffee();

            coffee = new Sugar(coffee);
            coffee = new Sugar(coffee);
            coffee = new Sugar(coffee);
            coffee = new Whipp(coffee);
            coffee = new Milk(coffee);

            Console.WriteLine("Details: " + coffee.GetDetails());
            Console.WriteLine("Cost: " + coffee.GetCost());

            Console.ReadKey();
        }