public GetDayOfWeek ( System.DateTime time ) : DayOfWeek | ||
time | System.DateTime | |
리턴 | DayOfWeek |
public void PosTest1() { System.Globalization.Calendar tbc = new ThaiBuddhistCalendar(); Random rand = new Random(-55); int year = rand.Next(tbc.MinSupportedDateTime.Year + 543, tbc.MaxSupportedDateTime.Year + 544); int month = rand.Next(1, 12); int day; if (IsLeapYear(year)) { day = rand.Next(1, _DAYS_PER_MONTHS_IN_LEAP_YEAR[month] + 1); } else { day = rand.Next(1, _DAYS_PER_MONTHS_IN_NO_LEAP_YEAR[month] + 1); } DateTime dt = tbc.ToDateTime(year, month, day, 0, 0, 0, 0); DayOfWeek actualDay = getDayOfWeek(dt); Assert.Equal(actualDay, tbc.GetDayOfWeek(dt)); }
public void PosTest3() { System.Globalization.Calendar tbc = new ThaiBuddhistCalendar(); DateTime dt = tbc.MaxSupportedDateTime; Assert.Equal(DayOfWeek.Friday, tbc.GetDayOfWeek(dt)); }