Exemplo n.º 1
0
        public void Test_SunDays()
        {
            for (var testYear = 1950; testYear < 2100; testYear++)
            {
                var holidaylist = new Holidays <Danish>(testYear, true, false);
                var element     = holidaylist.First();
                Assert.IsTrue(element.Date.Day <= 7);

                element = holidaylist.Last();
                Assert.IsTrue(element.Date.Day <= 31);
                Assert.IsTrue(element.Date.Day >= 31 - 6);

                Debug.WriteLine("Test year {0}", testYear);

                foreach (var holiday in holidaylist)
                {
                    Assert.IsTrue(holiday.Date.DayOfWeek == DayOfWeek.Sunday);
                    Assert.IsTrue(holiday.Date.Year == testYear);
                }
            }
        }