public void AddTest() { MathsHelper helper = new MathsHelper(); int result = helper.Add(20, 10); Assert.AreEqual(30, result); }
public void SubtractTest() { MathsHelper helper = new MathsHelper(); int result = helper.Subtract(20, 10); Assert.AreEqual(10, result); }
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(); }