예제 #1
0
        OrbitalPeriodTest(double expected_orbital_period,
                          OrbitingBodyMathematics planet)
        {
            double orbital_period         = planet.get_orbital_period();  // in seconds
            double orbital_period_in_days = orbital_period / 60 / 60 / 24;

            double acceptable_error = 0.001;
            double actual_error     = Math.Abs(orbital_period_in_days - expected_orbital_period);
            string error_message    = differing_results_error_message(
                Convert.ToString(orbital_period_in_days),
                Convert.ToString(expected_orbital_period),
                "days"
                );

            Assert.LessOrEqual(actual_error, acceptable_error, error_message);
        }