public void SqrtN_ValidInputParameters_NthRootWithPercisionReturned(double number, double n, double epsilon) { double calculatedValue = NewtonAlgorithm.SqrtN(number, n, epsilon); double exactValue = Math.Pow(number, 1.0 / n); Assert.Less(Math.Abs(exactValue - calculatedValue), epsilon); }
public void SqrtN_InvalidParameters_NthRootCannotBeTaken(double number, double n, double epsilon) { Assert.Throws <ArgumentException>(() => NewtonAlgorithm.SqrtN(number, n, epsilon)); }