コード例 #1
0
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();

            machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 100);
            machine.MakeDrink(HotDrinkMachine.AvailableDrink.Coffee, 150);

            Console.ReadLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();
            var tea     = machine.MakeDrink(nameof(Tea), 150);

            tea.Consume();
            var coffee = machine.MakeDrink(nameof(Coffee), 70);

            coffee.Consume();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: rfabianf/BestPractices
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();
            var drink   = machine.MakeDrink(AvailableDrink.Chocolate, 300);

            drink.Consume();
        }
コード例 #4
0
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();
            var drink   = machine.MakeDrink();

            drink.Consume();
        }
コード例 #5
0
        public static void Main()
        {
            var machine = new HotDrinkMachine();
            var drink   = machine.MakeDrink();

            drink.Consume();
        }
コード例 #6
0
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();
            // var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Coffee, 2);
            var drink = machine.MakeDrink();

            drink.Consume();
        }
コード例 #7
0
        static void Main(string[] args)
        {
            var m = new HotDrinkMachine();
            //var d = m.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 5);
            //d.Consume();

            var d = m.MakeDrink();
        }
コード例 #8
0
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();
            var drink   = machine.MakeDrink();

            //drink.Consume();
            WriteLine("Hello World!");
            ReadKey();
        }
コード例 #9
0
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();
            var drink   = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 100);

            drink.consumes();

            Console.ReadLine();
        }
コード例 #10
0
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();
            //var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 300);
            //drink.Consume();

            IHotDrink drink = machine.MakeDrink();

            drink.Consume();
        }
コード例 #11
0
        static void Main(string[] args)
        {
            HotDrinkMachine hotDrinkMachine = new HotDrinkMachine();

            hotDrinkMachine.MakeDrink(HotDrinkMachine.AvailableDrinks.Coffee, 2).Consume();
            WriteLine("");
            ReadKey();

            // Go to http://aka.ms/dotnet-get-started-console to continue learning how to build a console app!
        }
コード例 #12
0
        // OCP - open close principal
        static void Main(string[] args)
        {
            WriteLine("Abstract Factory Method \n");

            var machine = new HotDrinkMachine();
            var drink   = machine.MakeDrink();

            // var drink = machine.MakeDrink(HotDrinkMachine.AvailableDrink.Tea, 100);
            drink.Consume();
            WriteLine();
        }
コード例 #13
0
        static void Main(string[] args)
        {
            var hdm = new HotDrinkMachine();
            //var drink = hdm.MakeDrink(HotDrinkMachine.AvailableDrink.Coffee, 100);
            //drink.Consume();
            var drink = hdm.MakeDrink();

            drink.Consume();


            Console.Read();
        }
コード例 #14
0
        static void Main(string[] args)
        {
            var machine = new HotDrinkMachine();
            //var drink = machine.MakeDrink(HotDrinkMachine.AvaibleDrink.Tea, 100);
            //drink.Consume();
            //WriteLine();

            //var drink2 = machine.MakeDrink(HotDrinkMachine.AvaibleDrink.Coffee, 100);
            //drink2.Consume();
            //ReadKey();
            var drink = machine.MakeDrink();

            drink.Consume();
            ReadKey();
        }