Exemplo n.º 1
0
        public void CheckEasterSunday()
        {
            var catholicProvider = new MockProvider(new CatholicProvider());

            var easterSunday = catholicProvider.EasterSunday(1900);

            Assert.AreEqual(new DateTime(1900, 4, 15), easterSunday);

            easterSunday = catholicProvider.EasterSunday(2014);
            Assert.AreEqual(new DateTime(2014, 4, 20), easterSunday);

            easterSunday = catholicProvider.EasterSunday(2015);
            Assert.AreEqual(new DateTime(2015, 4, 5), easterSunday);

            easterSunday = catholicProvider.EasterSunday(2016);
            Assert.AreEqual(new DateTime(2016, 3, 27), easterSunday);

            easterSunday = catholicProvider.EasterSunday(2017);
            Assert.AreEqual(new DateTime(2017, 4, 16), easterSunday);

            easterSunday = catholicProvider.EasterSunday(2018);
            Assert.AreEqual(new DateTime(2018, 4, 1), easterSunday);

            easterSunday = catholicProvider.EasterSunday(2019);
            Assert.AreEqual(new DateTime(2019, 4, 21), easterSunday);

            easterSunday = catholicProvider.EasterSunday(2020);
            Assert.AreEqual(new DateTime(2020, 4, 12), easterSunday);

            easterSunday = catholicProvider.EasterSunday(2200);
            Assert.AreEqual(new DateTime(2200, 4, 6), easterSunday);
        }
Exemplo n.º 2
0
        public void TestGermanyCorpusChristi()
        {
            var yearToTest       = 2017;
            var catholicProvider = new MockProvider(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);
        }
Exemplo n.º 3
0
        public void PuertoRicoHasGoodFridayHoliday()
        {
            var holidays = DateSystem.GetPublicHoliday(CountryCode.PR, 2017);

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

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

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