public void Calculate(double input, double output) { var calculator = new Squared(); var testResult = calculator.Calculate(input); var result = output; Assert.AreEqual(testResult, result); }
void Run() { Squared s = new Squared(); var val = s.Calculate(int.MinValue); val = s.Calculate(int.MaxValue); var testSuite = new[] { new { N = -100, D = -100, E = 1, M = "Message" } }; //Test(num, den, -1, $"Div {num} by {den} test passed"); Fraction fraction = new Fraction(); fraction.Numerator = 0; var Passed = false; try { fraction.Denominator = 0; } catch (DivideByZeroException) { Passed = true; } Debug.WriteLine($"The test passed : {Passed}"); }