public void GetNthRoot_Test() { double number = double.Parse(TestContext.DataRow["number"].ToString()); int power = int.Parse(TestContext.DataRow["power"].ToString()); double accuracy = double.Parse(TestContext.DataRow["accuracy"].ToString()); double expected = double.Parse(TestContext.DataRow["expectedResult"].ToString()); double actual = RootSearcher.FindNthRoot(number, power, accuracy); Assert.AreEqual(actual, expected, accuracy); }
public void FindRoot_Throws_ArgumentException(double number, int power, double accuracy) => Assert.Throws <ArgumentException>(() => RootSearcher.FindNthRoot(number, power, accuracy));
public double FindRoot_IsCorrect(double number, int power, double accuracy) => RootSearcher.FindNthRoot(number, power, accuracy);
public void FindNthRootmethod_UncorrectData_ArgumentException(double number, int n, double eps) { Assert.ThrowsException <ArgumentException>(() => RootSearcher.FindNthRoot(number, n, eps)); }