Пример #1
0
        public void SolveEquationTest0()
        {
            QuadraticEquation2 qe2 = new QuadraticEquation2();

            qe2.A = 1;
            qe2.B = 1;
            qe2.C = 4;
            double[] expected = { };
            double[] result   = qe2.SolveEquation();
            Assert.Equal(result.Length, 0);
        }
Пример #2
0
        public void SolveEquationTest1()
        {
            QuadraticEquation2 qe2 = new QuadraticEquation2();

            qe2.A = 1;
            qe2.B = 2;
            qe2.C = 1;

            double[] expected = { -1 };
            double[] result   = qe2.SolveEquation();
            Assert.Equal <double[]>(expected, result);
        }
Пример #3
0
        public void SolveEquationTest2(double a, double b, double c, double[] expected)
        {
            QuadraticEquation2 qe2 = new QuadraticEquation2();

            qe2.A = a;
            qe2.B = b;
            qe2.C = c;

            double[] result = qe2.SolveEquation();
            Array.Sort(expected);
            Array.Sort(result);
            Assert.Equal <double[]>(expected, result);
        }