public static void Main()
        {
            var localCoffePlace = new CoffeeFactory();
            var regularCoffe = localCoffePlace.GetCoffee(CoffeType.Regular);

            Console.WriteLine("Regular coffee - Milk content: {0} ml, Coffee content: {1} ml", regularCoffe.MilkContent, regularCoffe.CoffeeContent);
        }
        public void TestCoffeeFactory()
        {
            var coffePlace = new CoffeeFactory();
            var capuchino = coffePlace.GetCoffee(CoffeType.Cappuccino);

            Assert.AreEqual(capuchino.CoffeeContent, 100);
        }
Exemplo n.º 3
0
 public static void Main()
 {
     var coffeeFactory = new CoffeeFactory();
     var cappuccino = coffeeFactory.GetCoffee(CoffeeType.Cappuccino);
     var regularCoffee = coffeeFactory.GetCoffee(CoffeeType.Regular);
     Console.WriteLine("Cappuccino - Milk content: {0} ml, Coffee content: {1} ml", cappuccino.MilkContent, cappuccino.CoffeeContent);
     Console.WriteLine("Regular coffee - Milk content: {0} ml, Coffee content: {1} ml", regularCoffee.MilkContent, regularCoffee.CoffeeContent);
 }
Exemplo n.º 4
0
        public static void Main()
        {
            var coffeeFactory = new CoffeeFactory();
            var cappuccino    = coffeeFactory.GetCoffee(CoffeeType.Cappuccino);
            var regularCoffee = coffeeFactory.GetCoffee(CoffeeType.Regular);

            Console.WriteLine("Cappuccino - Milk content: {0} ml, Coffee content: {1} ml", cappuccino.MilkContent, cappuccino.CoffeeContent);
            Console.WriteLine("Regular coffee - Milk content: {0} ml, Coffee content: {1} ml", regularCoffee.MilkContent, regularCoffee.CoffeeContent);
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            Console.Write("Enter coffee number: ");
            int        coffeeNumber = int.Parse(Console.ReadLine());
            CoffeeType coffeeType   = (CoffeeType)coffeeNumber;

            Coffee coffee = CoffeeFactory.GetCoffee(coffeeType);

            coffee.Print();

            Console.ReadKey(true);
        }