예제 #1
0
        public void CheckEasterSunday(int year, int month, int day)
        {
            var catholicProvider = new MockPublicHolidayProvider(new CatholicProvider());

            var easterSunday = catholicProvider.EasterSunday(year);

            Assert.AreEqual(new DateTime(year, month, day), easterSunday);
        }
예제 #2
0
        public void TestGermanyCorpusChristi()
        {
            var yearToTest       = 2017;
            var catholicProvider = new MockPublicHolidayProvider(new CatholicProvider());
            var publicHolidays   = DateSystem.GetPublicHoliday(yearToTest, CountryCode.DE);
            var easterSunday     = catholicProvider.EasterSunday(yearToTest);
            var corpusChristi    = publicHolidays.First(x => x.LocalName == "Fronleichnam").Date;

            Assert.AreEqual(easterSunday.AddDays(60), corpusChristi);
        }
예제 #3
0
        public void PuertoRicoHasGoodFridayHoliday()
        {
            var holidays = DateSystem.GetPublicHolidays(2017, CountryCode.PR);

            var catholic           = new MockPublicHolidayProvider(new CatholicProvider());
            var expectedGoodFriday = catholic.EasterSunday(2017).AddDays(-2);

            var goodFriday = holidays.First(holiday => holiday.Name == "Good Friday");

            Assert.IsNotNull(goodFriday);
            Assert.AreEqual(expectedGoodFriday.Day, goodFriday.Date.Day);
        }