コード例 #1
0
        public void FindNthRoot_CorrectValuesPassed_WorksCorrectly(double initialNumber, int degree, double precision,
                                                                   double expectedValue)
        {
            double actualValue = NumericUtils.FindNthRoot(initialNumber, degree, precision);

            Assert.That(expectedValue, Is.EqualTo(NumericUtils.FindNthRoot(initialNumber, degree, precision)).Within(precision));
        }
コード例 #2
0
 public void FindNthRoot_IncorrectPrecisionPassed_ArgumentOutOfRangeExceptionThrown(double initialNumber,
                                                                                    int degree, double precision)
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => NumericUtils.FindNthRoot(initialNumber, degree, precision));
 }