コード例 #1
0
        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}");
        }
コード例 #2
0
        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);
        }