Ejemplo n.º 1
0
        public void TestLnEq()
        {
            var testSubject = new NaturalLogEquation {
                Slope = 7.123, Intercept = -55.44
            };
            const double X_IN   = 1985;
            var          solveY = testSubject.SolveForY(X_IN);

            var solveX = testSubject.SolveForX(solveY);

            Assert.AreEqual(System.Math.Round(X_IN), System.Math.Round(solveX));
        }
Ejemplo n.º 2
0
        public void TestNaturalLogEquation()
        {
            var testSubject = new NaturalLogEquation {
                Intercept = 2, Slope = 1.2
            };

            var x           = 11.0D;
            var testResultY = testSubject.SolveForY(x);
            var testResultX = testSubject.SolveForX(testResultY);

            Console.WriteLine(testResultX);

            Assert.AreEqual(x, System.Math.Round(testResultX));//some kind of float-pt loss
        }