Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 public static void ArithmeticExceptionTest(double a, double b, double c)
 {
     Assert.Throws <ArithmeticException>(() => Task4.SolveSquareEquation(a, b, c));
 }
Beispiel #3
0
 public static void DivideByZeroExceptionTest(double a, double b, double c)
 {
     Assert.Throws <DivideByZeroException>(() => Task4.SolveSquareEquation(a, b, c));
 }