public void FindNthRootMethodTest_DataSourceFileAlgorithmsTestXML()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");

            double number    = Convert.ToDouble(TestContext.DataRow["number"]);
            int    power     = Convert.ToInt32(TestContext.DataRow["power"]);
            double accurancy = Convert.ToDouble(TestContext.DataRow["accurancy"]);
            double expected  = Convert.ToDouble(TestContext.DataRow["expectedResult"]);

            Assert.AreEqual(expected, AlgorithmsLib.FindNthRoot(number, power, accurancy), accurancy);
        }
예제 #2
0
 public void FindNthRootMethodTest_WithData_0dot01_2__neg1ThrowArgumentException()
 => Assert.Throws <ArgumentException>(() => AlgorithmsLib.FindNthRoot(0.01, 2, -1));
예제 #3
0
 public void FindNthRootMethodTest_WithData_negative0dot01_2__0dot0001ThrowArgumentException()
 => Assert.Throws <ArgumentException>(() => AlgorithmsLib.FindNthRoot(-0.01, 2, 0.0001));
예제 #4
0
 public void FindNthRootMethod(double number, int power, double accuracy, double expectedResult)
 {
     Assert.AreEqual(AlgorithmsLib.FindNthRoot(number, power, accuracy), expectedResult, accuracy);
 }
 public void FindNthRootMethodTest_WithData_0dot001_neg2__0dot0001ThrowArgumentException()
 => AlgorithmsLib.FindNthRoot(0.001, -2, 0.0001);