示例#1
0
        public void AddTest()
        {
            MathsHelper helper = new MathsHelper();
            int         result = helper.Add(20, 10);

            Assert.AreEqual(30, result);
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter two numbers\n");
            int number1;
            int number2;

            number1 = int.Parse(Console.ReadLine());
            number2 = int.Parse(Console.ReadLine());

            MathsHelper helper = new MathsHelper();
            int         x      = helper.Add(number1, number2);

            Console.WriteLine("\nThe sum of " + number1 +
                              " and " + number2 + " is " + x);
            Console.ReadKey();
            int y = helper.Subtract(number1, number2);

            Console.WriteLine("\nThe difference between " +
                              number1 + " and" + number2 + "  is " + y);
            Console.ReadKey();
        }