public void Test_1__2_6_9() { int a = 2, b = 6, c = 9; string actError, expError = "Нет корней"; double[] expResult = new double[0]; double[] actResult = SolveEq.Solve(a, b, c, out actError); Assert.AreEqual(expError, actError, "Полученное сообщение (" + actError + ") об ошибке не совпадает с ожидаемым (" + expError + ")"); Assert.AreEqual(expResult.Length, actResult.Length); for (int i = 0; i < expResult.Length; i++) { Assert.AreEqual(expResult[i], actResult[i]); } }
private void Button_Click(object sender, EventArgs e) { try { string error = ""; double[] solution = SolveEq.Solve(int.Parse(textBox1.Text), int.Parse(textBox2.Text), int.Parse(textBox3.Text), out error); foreach (double item in solution) { button2.Text += Math.Round(item, 4).ToString() + "; "; } button2.Text += error; } catch (Exception) { return; } }