示例#1
0
        public void DiscriminantIsSmallerThanZero()
        {
            string             a = "1", b = "1", c = "1";
            string             expected = null;
            SolutionOfEquation soe      = new SolutionOfEquation(ref a, ref b, ref c);

            string actual = null;

            Assert.AreEqual(expected, actual);
        }
示例#2
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]);
        }
示例#3
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"); // где бля вывод?
        }
示例#4
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());
            }
        }
示例#5
0
        public void InputSymbols()
        {
            string a_Incorrect = "qwe";
            string b_Incorrect = "e12";
            string c_Incorrect = "32a";
            string a_Correct   = "qwe";
            string b_Correct   = "e12";
            string c_Correct   = "32a";

            SolutionOfEquation soe = new SolutionOfEquation(ref a_Correct, ref b_Correct, ref c_Correct);

            Assert.AreNotEqual(a_Correct, a_Incorrect, "a_Correct != a_Incorrect\n");
            Assert.AreNotEqual(b_Correct, b_Incorrect, "b_Correct != b_Incorrect\n");
            Assert.AreNotEqual(c_Correct, c_Incorrect, "b_Correct != b_Incorrect\n");
        }