public void N_IsCalculatedCorrectly(double m, double p, double k0, double e, double kn, double expectedN) { const double localTolerance = 0.01; var n = FinancialCalculation.N(kn, k0, e, p, m); Assert.True(Math.Abs(n - expectedN) < localTolerance); }
[InlineData(12, 5.3660387, -10000, -550, 1000000, 39.78)] // --+ public void NAdvance_IsCalculatedCorrectly_PermutationOfRealNumbers(double m, double p, double k0, double e, double kn, double expectedN) { const double localTolerance = 0.01; var n = FinancialCalculation.N(kn, k0, e, p, m, true); Assert.True(Math.Abs(n - expectedN) < localTolerance); }
[InlineData(12, 5.3660387, -10000, -550, -1000000)] // --- public void NAdvance_IsCalculatedCorrectly_PermutationOfNan(double m, double p, double k0, double e, double kn) { var n = FinancialCalculation.N(kn, k0, e, p, m); Assert.True(double.IsNaN(n)); }