Ejemplo n.º 1
0
        public void TestHolidays2017(int month, int day)
        {
            var holiday         = new DateTime(2017, month, day);
            var holidayCalendar = new AustriaPublicHoliday();
            var actual          = holidayCalendar.IsPublicHoliday(holiday);

            Assert.IsTrue(actual, $"{holiday.ToString("D")} is not a holiday");
        }
Ejemplo n.º 2
0
        public void TestHolidayListIsPublicHoliday()
        {
            //github issue #12, @oliver-h
            var h = new AustriaPublicHoliday();

            for (int year = 2010; year < 2018; year++)
            {
                var days = h.PublicHolidayNames(year);
                var fd   = days.Where(d => !h.IsPublicHoliday(d.Key)).ToArray();

                if (fd.Any())
                {
                    var s = string.Join(Environment.NewLine, fd);
                    Console.WriteLine(s);
                    Assert.Fail($"Dates in list are not public holidays: {s}");
                }
            }
        }