/// <summary>Method to assert that ArgumentOutOfRangeException is raised in some cases /// </summary> /// <param name="number">A real number</param> /// <param name="orderOfRoot">An integer positive number</param> /// <param name="accuracy">A real positive number</param> public void ShouldFindNthRoot_ArgumentOutOfRangeException(double number, int orderOfRoot, double accuracy) { Assert.Throws <ArgumentOutOfRangeException>(() => Task0801.FindNthRoot(number, orderOfRoot, accuracy)); }
/// <summary>Method to assert that Nth root is found with a given accuracy /// </summary> /// <param name="number">A real number</param> /// <param name="orderOfRoot">An integer positive number</param> /// <param name="accuracy">A real positive number</param> /// <param name="expectedResult">A real number as the expected result</param> public void ShouldFindNthRoot_WithTolerance(double number, int orderOfRoot, double accuracy, double?expectedResult) { var result = Task0801.FindNthRoot(number, orderOfRoot, accuracy); Assert.That(result, Is.EqualTo(expectedResult).Within(accuracy)); }