コード例 #1
0
        public void GetNthRoot_Test()
        {
            double number   = double.Parse(TestContext.DataRow["number"].ToString());
            int    power    = int.Parse(TestContext.DataRow["power"].ToString());
            double accuracy = double.Parse(TestContext.DataRow["accuracy"].ToString());
            double expected = double.Parse(TestContext.DataRow["expectedResult"].ToString());
            double actual   = RootSearcher.FindNthRoot(number, power, accuracy);

            Assert.AreEqual(actual, expected, accuracy);
        }
コード例 #2
0
 public void FindRoot_Throws_ArgumentException(double number, int power, double accuracy)
 => Assert.Throws <ArgumentException>(() => RootSearcher.FindNthRoot(number, power, accuracy));
コード例 #3
0
 public double FindRoot_IsCorrect(double number, int power, double accuracy) =>
 RootSearcher.FindNthRoot(number, power, accuracy);
コード例 #4
0
 public void FindNthRootmethod_UncorrectData_ArgumentException(double number, int n, double eps)
 {
     Assert.ThrowsException <ArgumentException>(() => RootSearcher.FindNthRoot(number, n, eps));
 }