Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            CalculateClient client = new CalculateClient();

            client.SetCalculate(new Minus());
            Console.WriteLine("Minus: " + client.Calculate(8, 2));

            client.SetCalculate(new Plus());
            Console.WriteLine("Plus: " + client.Calculate(7, 2));
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var minusClient = new CalculateClient(new Minus());

            Console.WriteLine("10 - 3 = " + minusClient.Calculate(10, 3));

            var plusClient = new CalculateClient(new Plus());

            Console.WriteLine("10 + 3 = " + plusClient.Calculate(10, 3));
            Console.ReadKey();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var minusClient = new CalculateClient(new Minus());

            Console.WriteLine("10 - 3 = " + minusClient.Calculate(10, 3));

            var plusClient = new CalculateClient(new Plus());

            Console.WriteLine("10 + 3 = " + plusClient.Calculate(10, 3));
            Console.ReadKey();
        }