예제 #1
0
 public void EqualsType1_Negative()
 {
     try
     {
         MyVariables.EqualsType1(1, 1);
     }
     catch
     {
         Assert.Pass();
     }
     Assert.Fail();
 }
예제 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Введите коэффициент a: ");
            int a = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Введите коэффициент b: ");
            int b = Convert.ToInt32(Console.ReadLine());

            if (b != 0)
            {
                int rep = MyVariables.EqualsType1(a, b);
                Console.WriteLine($"X равен {rep}");
            }
            else
            {
                Console.WriteLine("Коэффициент b не должен быть равен нулю");
            }
        }
예제 #3
0
        public void EqualsType1_Positive(int a, int b, int expected)
        {
            int actual = MyVariables.EqualsType1(a, b);

            Assert.AreEqual(expected, actual);
        }