public void TestHolidays2017(int month, int day, string name) { var holiday = new DateTime(2017, month, day); var holidayCalendar = new PolandPublicHoliday(); var actual = holidayCalendar.IsPublicHoliday(holiday); Assert.IsTrue(actual, $"{holiday.ToString("D")} is not a holiday -{name}"); }
public DayType GetCurrentDayType() { var polandPublicHoliday = new PolandPublicHoliday(); if (polandPublicHoliday.IsPublicHoliday(DateTime.Now) || DateTime.Now.DayOfWeek == DayOfWeek.Sunday) { return(DayType.Sunday); } return(DateTime.Now.DayOfWeek == DayOfWeek.Saturday ? DayType.Saturday : DayType.Weekday); }