Ejemplo n.º 1
0
        public void DiscriminantEqualZero()
        {
            string a = "1", b = "2", c = "1";

            double[]           expected = { -1, -1 };
            SolutionOfEquation soe      = new SolutionOfEquation(ref a, ref b, ref c);

            double[] actual             = soe.Solution(a, b, c);

            Assert.AreEqual(expected[0], actual[0]);
            Assert.AreEqual(expected[1], actual[1]);
        }
Ejemplo n.º 2
0
        public void DiscriminantIsBiggerThanZero()
        {
            string a = "1", b = "3", c = "2";

            double[]           expected = { -1, -2 };
            SolutionOfEquation soe      = new SolutionOfEquation(ref a, ref b, ref c);

            double[] actual             = soe.Solution(a, b, c);

            Assert.AreEqual(expected[0], actual[0]);
            Assert.AreEqual(expected[1], actual[1], "dsada"); // где бля вывод?
        }
Ejemplo n.º 3
0
        static void Main()
        {
            Console.WriteLine("Your coefficients?");
            string             a = Console.ReadLine(), b = Console.ReadLine(), c = Console.ReadLine();
            SolutionOfEquation soe = new SolutionOfEquation(ref a, ref b, ref c);

            double[] answers = new double[2];
            answers = soe.Solution(a, b, c);
            Console.WriteLine();
            if (answers != null)
            {
                Console.WriteLine("x1 = {0}\nx2 = {1}", answers[0].ToString(), answers[1].ToString());
            }
        }