예제 #1
0
 public void TestDayOfWeek()
 {
     Assert.AreEqual(WeekDay.Thursday, SweDate.DayOfWeek(SweDate.DateToJulianDay(2014, 5, 1, 0, DateCalendar.Gregorian)));
     Assert.AreEqual(WeekDay.Friday, SweDate.DayOfWeek(SweDate.DateToJulianDay(2014, 5, 2, 0, DateCalendar.Gregorian)));
     Assert.AreEqual(WeekDay.Saturday, SweDate.DayOfWeek(SweDate.DateToJulianDay(2014, 5, 3, 0, DateCalendar.Gregorian)));
     Assert.AreEqual(WeekDay.Sunday, SweDate.DayOfWeek(SweDate.DateToJulianDay(2014, 5, 4, 0, DateCalendar.Gregorian)));
     Assert.AreEqual(WeekDay.Monday, SweDate.DayOfWeek(SweDate.DateToJulianDay(2014, 5, 5, 0, DateCalendar.Gregorian)));
     Assert.AreEqual(WeekDay.Tuesday, SweDate.DayOfWeek(SweDate.DateToJulianDay(2014, 5, 6, 0, DateCalendar.Gregorian)));
     Assert.AreEqual(WeekDay.Wednesday, SweDate.DayOfWeek(SweDate.DateToJulianDay(2014, 5, 7, 0, DateCalendar.Gregorian)));
 }
예제 #2
0
        public void TestDateToJulianDay()
        {
            using (var swe = new Sweph()) {
                Assert.AreEqual(0.0, SweDate.DateToJulianDay(new DateUT(-4713, 11, 24, 12, 0, 0), DateCalendar.Gregorian));
                Assert.AreEqual(-38.0, SweDate.DateToJulianDay(new DateUT(-4713, 11, 24, 12, 0, 0), DateCalendar.Julian));
                Assert.AreEqual(-38.0, SweDate.DateToJulianDay(new DateUT(-4713, 11, 24, 12, 0, 0)));
                Assert.AreEqual(0.0, SweDate.DateToJulianDay(-4713, 11, 24, 12, 0, 0, DateCalendar.Gregorian));
                Assert.AreEqual(0.0, SweDate.DateToJulianDay(-4713, 11, 24, 12.0, DateCalendar.Gregorian));
                Assert.AreEqual(0.0, SweDate.DateToJulianDay(-4712, 1, 1, 12.0, DateCalendar.Julian));

                Assert.AreEqual(2000000.0, SweDate.DateToJulianDay(763, 9, 18, 12.0, DateCalendar.Gregorian));
                Assert.AreEqual(2000000.0, SweDate.DateToJulianDay(763, 9, 14, 12.0, DateCalendar.Julian));

                Assert.AreEqual(1063884.0, SweDate.DateToJulianDay(-1800, 9, 18, 12.0, DateCalendar.Gregorian));
                Assert.AreEqual(1063865.0, SweDate.DateToJulianDay(-1800, 9, 14, 12.0, DateCalendar.Julian));
            }
        }