Exemplo n.º 1
0
        static void Main(string[] args)
        {
            //We create a new coffemachine
            CoffeeMachine MyCoffeeMachine = new CoffeeMachine();

            //We fill both compartments up
            MyCoffeeMachine.Water.Fill();
            MyCoffeeMachine.Department.Fill(new CoffeePowder());

            //We brew the coffee and check the status
            Console.WriteLine(MyCoffeeMachine.Brew());

            MyCoffeeMachine.Water.Fill();
            MyCoffeeMachine.Department.Fill(new TeaPowder());

            //And check if we can brew a cup more
            Console.WriteLine(MyCoffeeMachine.Brew());
            Console.ReadKey();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //We create a new coffemachine
            CoffeeMachine MyCoffeeMachine = new CoffeeMachine();

            //We fill both compartments up
            MyCoffeeMachine.Water.Fill();
            MyCoffeeMachine.Department.Fill(new EspressoPowder());

            //We brew the coffee and check the status
            Console.WriteLine(MyCoffeeMachine.Brew(1));
            Console.WriteLine(MyCoffeeMachine.CoffeeCupsAvailable.Count);

            Console.ReadKey();
        }