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)); }
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(); }