コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: SergeyChagai/Homework4
 public void EqualsType1_Negative()
 {
     try
     {
         MyVariables.EqualsType1(1, 1);
     }
     catch
     {
         Assert.Pass();
     }
     Assert.Fail();
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: SergeyChagai/Homework4
        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
ファイル: UnitTest1.cs プロジェクト: SergeyChagai/Homework4
        public void EqualsType1_Positive(int a, int b, int expected)
        {
            int actual = MyVariables.EqualsType1(a, b);

            Assert.AreEqual(expected, actual);
        }