static void Main(string[] args) { Console.WriteLine("***CALCULATOR***"); CheckIfProperInput.ShowMenu(); int chosenMethod; do { chosenMethod = CheckIfProperInput.CheckIfItIsNumber(); } while (chosenMethod == 0); while (chosenMethod < 0 || chosenMethod > 4) { Console.WriteLine(" "); Console.WriteLine("Choose the number from the list! One more chance: "); CheckIfProperInput.ShowMenu(); chosenMethod = int.Parse(Console.ReadLine()); } Console.Write("Type in first number: "); var num1 = double.Parse(Console.ReadLine()); Console.Write("Type in second number: "); var num2 = double.Parse(Console.ReadLine()); DoTheMath.Calculate(chosenMethod, num1, num2); Console.ReadLine(); }
public void testDivisionTotal() { //arrange var x = new DoTheMath(); x.performMath(1, 2, "divide"); Assert.AreEqual(x.total, .5); }
public void testSubtractionTotal() { //arrange var x = new DoTheMath(); x.performMath(1, 2, "subtract"); Assert.AreEqual(x.total, -1); }
public void testMultiplicationTotal() { //arrange var x = new DoTheMath(); x.performMath(1, 2, "multiply"); Assert.AreEqual(x.total, 2); }
public void testAdditionTotal() { //arrange var x = new DoTheMath(); x.performMath(1, 2, "add"); Assert.AreEqual(x.total, 3); }