Пример #1
0
        static void Main(string[] args)
        {
            Program           program = new Program();
            Homework1_Library library = new Homework1_Library();

            Console.WriteLine("Please enter the value of a");
            double a = program.InputChecker(Console.ReadLine());

            Console.WriteLine("Please enter the values of b");
            double b = program.InputChecker(Console.ReadLine());

            Console.WriteLine("Please enter the values of c");
            double c = program.InputChecker(Console.ReadLine());

            var disc = library.DiscriminantCalc(a, b, c);

            Console.WriteLine(library.Message);
            Console.WriteLine($"Square roots: {disc.x1}, {disc.x2}. Discriminant: {disc.d}");

            Console.ReadKey();
        }
        public void TestDiscriminant(double a, double b, double c, double expected)
        {
            var disc = _homework1_Library.DiscriminantCalc(a, b, c);

            Assert.AreEqual(expected, disc.d);
        }