Пример #1
0
 public void EqualsType2_Negative()
 {
     try
     {
         MyVariables.EqualsType2(0, 12, 34);
     }
     catch
     {
         Assert.Pass();
     }
     Assert.Fail();
 }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Уравнение типа \"a * x + b = c\"\nВведите коэффициенты a, b и c");
            Console.Write("a = ");
            int a = Convert.ToInt32(Console.ReadLine());

            Console.Write("b = ");
            int b = Convert.ToInt32(Console.ReadLine());

            Console.Write("c = ");
            int c = Convert.ToInt32(Console.ReadLine());

            if (a == 0)
            {
                Console.WriteLine("Коэффициент \"a\" не должен юыть равен нулю");
            }
            else
            {
                Console.WriteLine($"X равен {MyVariables.EqualsType2(a, b, c)}");
            }
        }
Пример #3
0
        public void EqualsType2_Positive(int a, int b, int c, double expected)
        {
            double actual = MyVariables.EqualsType2(a, b, c);

            Assert.AreEqual(expected, actual, 0.0000001);
        }