public void EqualsType1_Negative() { try { MyVariables.EqualsType1(1, 1); } catch { Assert.Pass(); } Assert.Fail(); }
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 не должен быть равен нулю"); } }
public void EqualsType1_Positive(int a, int b, int expected) { int actual = MyVariables.EqualsType1(a, b); Assert.AreEqual(expected, actual); }