Example #1
0
        public void Test1__0_1_min1()
        {
            double a = 0, b = 1, c = -1;
            string expResult = "x=1";
            KVADR  kv        = new KVADR(a, b, c);

            kv.Decision();
            string actResult = kv.ToString();

            Assert.AreEqual(expResult, actResult);
        }
Example #2
0
        public void Test1__1_1_min2()
        {
            double a = 1, b = 1, c = -2;
            string expResult = "x1=1   x2=-2";
            KVADR  kv        = new KVADR(a, b, c);

            kv.Decision();
            string actResult = kv.ToString();

            Assert.AreEqual(expResult, actResult);
        }
Example #3
0
        public void Test1__0_0_0()
        {
            double a = 0, b = 0, c = 0;
            string expResult = "любое число";
            KVADR  kv        = new KVADR(a, b, c);

            kv.Decision();
            string actResult = kv.ToString();

            Assert.AreEqual(expResult, actResult);
        }
Example #4
0
        public void Test1__1_1_1()
        {
            double a = 1, b = 1, c = 1;
            string expResult = "нет корней";
            KVADR  kv        = new KVADR(a, b, c);

            kv.Decision();
            string actResult = kv.ToString();

            Assert.AreEqual(expResult, actResult);
        }
Example #5
0
        static void Main(string[] args)
        {
            //try
            //{
            Console.WriteLine("a=");
            double a = double.Parse(Console.ReadLine());

            Console.WriteLine("b=");
            double b = double.Parse(Console.ReadLine());

            Console.WriteLine("c=");
            double c   = double.Parse(Console.ReadLine());
            KVADR  kv2 = new KVADR(a, b, c);

            kv2.Decision();
            Console.WriteLine(kv2.ToString());
            //}
            //catch (Exception error)
            //{
            //    Console.WriteLine(error.Message);
            //}
        }