Пример #1
0
        public void Test_swe_date_conversion()
        {
            using (var swe = new SwissEph()) {
                int year = 1974, month = 8, day = 16; double hour = 0.5; double tjd = 0.0;

                var res = swe.swe_date_conversion(year, month, day, hour, 'g', ref tjd);
                Assert.Equal(SwissEph.OK, res);
                Assert.Equal(2442275.52083333, tjd, 8);

                res = swe.swe_date_conversion(year, month, day, hour, 'j', ref tjd);
                Assert.Equal(SwissEph.OK, res);
                Assert.Equal(2442288.52083333, tjd, 8);

                res = swe.swe_date_conversion(year, month, 32, hour, 'j', ref tjd);
                Assert.Equal(SwissEph.ERR, res);
            }
        }
Пример #2
0
        public void Test_swe_date_conversion()
        {
            using (var swe = new SwissEph()) {
                int year = 1974, month = 8, day = 16; double hour = 0.5; double tjd = 0.0;

                var res = swe.swe_date_conversion(year, month, day, hour, 'g', ref tjd);
                Assert.AreEqual(SwissEph.OK, res);
                Assert.AreEqual(2442275.52083333, tjd, 0.0000001);

                res = swe.swe_date_conversion(year, month, day, hour, 'j', ref tjd);
                Assert.AreEqual(SwissEph.OK, res);
                Assert.AreEqual(2442288.52083333, tjd, 0.0000001);

                res = swe.swe_date_conversion(year, month, 32, hour, 'j', ref tjd);
                Assert.AreEqual(SwissEph.ERR, res);
            }
        }