public void SolveSquareEquationTests(double a, double b, double c, double[] expected) { double[] actual = Task4.SolveSquareEquation(a, b, c); double delta = 0.01; if (expected.Length != actual.Length) { Assert.Fail(); } for (int i = 0; i < expected.Length; i++) { Assert.AreEqual(expected[i], actual[i], delta); } }
public static void ArithmeticExceptionTest(double a, double b, double c) { Assert.Throws <ArithmeticException>(() => Task4.SolveSquareEquation(a, b, c)); }
public static void DivideByZeroExceptionTest(double a, double b, double c) { Assert.Throws <DivideByZeroException>(() => Task4.SolveSquareEquation(a, b, c)); }