private static bool MainMenu() { Console.Clear(); Console.WriteLine("Welcome to the Introduction to Unit Testing"); Console.WriteLine("We will be running a simple calculator"); Console.WriteLine("Enter an option:"); Console.WriteLine("1) Addition"); Console.WriteLine("2) Subtraction"); Console.WriteLine("3) Exit"); Console.Write("\r\nSelect an option: "); switch (Console.ReadLine()) { case "1": Addition.AddNumbers(); return(true); case "2": Console.WriteLine("No exist yet"); return(true); case "3": return(false); default: return(true); } }
public void AdditionOperationSumsCorrectly(int number1, int number2, int expectedSum) { var additionCalculator = new Addition(); var calculatedSum = additionCalculator.AddNumbers(number1, number2); Assert.AreEqual(expectedSum, calculatedSum); }
public void CheckAdditionMethod() { Addition additionNumber = new Addition(); int expectedResult = 9; int actualResult = additionNumber.AddNumbers(5, 4); Assert.AreEqual(expectedResult, actualResult); }
public int Add(int number1, int number2) { return(_addition.AddNumbers(number1, number2)); }