static void TestInvalid(int testId, int nbr) { try { var result = Arithmetic.sqr(nbr); Console.WriteLine($"Test #{testId}: Fail"); } catch (Exception) { Console.WriteLine($"Test #{testId}: Pass"); } }
static void TestValid(int testId, int nbr, int expected) { try { var actual = Arithmetic.sqr(nbr); if (actual == expected) { Console.WriteLine($"Test #{testId}: Pass"); } else { Console.WriteLine($"Test #{testId}: Fail"); } } catch (Exception) { Console.WriteLine($"Test #{testId}: Fail"); } }