示例#1
0
 public void SuccsesfullTests()
 {
     Assert.AreEqual(NewtonRoot.FindNthRoot(1, 5, 0.0001), 1);
     Assert.AreEqual(NewtonRoot.FindNthRoot(8, 3, 0.0001), 2);
     Assert.AreEqual(NewtonRoot.FindNthRoot(0.001, 3, 0.0001), 0.1);
     Assert.AreEqual(NewtonRoot.FindNthRoot(0.04100625, 4, 0.0001), 0.45);
     Assert.AreEqual(NewtonRoot.FindNthRoot(0.0279936, 7, 0.0001), 0.6);
     Assert.AreEqual(NewtonRoot.FindNthRoot(0.0081, 4, 0.1), 0.3);
     Assert.AreEqual(NewtonRoot.FindNthRoot(-0.008, 3, 0.1), -0.2);
     Assert.AreEqual(NewtonRoot.FindNthRoot(0.004241979, 9, 0.00000001), 0.545);
 }
 public void FindingRoots_Throws_ArgumentExeption(double number, int degree, double accuracy)
 {
     Assert.Throws <ArgumentException>(() => NewtonRoot.FindNthRoot(number, degree, accuracy));
 }
 public void FindingRoots_RealNumbers(double number, int degree, double accuracy, double expected)
 {
     Assert.AreEqual(NewtonRoot.FindNthRoot(number, degree, accuracy), expected, accuracy);
 }
示例#4
0
 public void NegativeArgument()
 {
     NewtonRoot.FindNthRoot(0.0279936, -3, -4);
 }