Example #1
0
        public void TestLabor2004()
        {
            var expected = new DateTime(2004, 9, 6);
            var actual   = USAPublicHoliday.LaborDay(2004);

            Assert.AreEqual(expected, actual);
        }
Example #2
0
        public void TestMemorial2004()
        {
            var expected = new DateTime(2004, 5, 31);
            var actual   = USAPublicHoliday.MemorialDay(2004);

            Assert.AreEqual(expected, actual);
        }
Example #3
0
        public void TestIndependence2004()
        {
            var expected = new DateTime(2004, 7, 5);
            var actual   = USAPublicHoliday.IndependenceDay(2004);

            Assert.AreEqual(expected, actual);
        }
Example #4
0
        public void TestVeterans2004()
        {
            var expected = new DateTime(2004, 11, 11);
            var actual   = USAPublicHoliday.VeteransDay(2004);

            Assert.AreEqual(expected, actual);
        }
Example #5
0
        public void TestWashington2004()
        {
            var expected = new DateTime(2004, 2, 16);
            var actual   = USAPublicHoliday.PresidentsDay(2004);

            Assert.AreEqual(expected, actual);
        }
Example #6
0
        public void TestThanksgiving2004()
        {
            var expected = new DateTime(2004, 11, 25);
            var actual   = USAPublicHoliday.Thanksgiving(2004);

            Assert.AreEqual(expected, actual);
        }
Example #7
0
        public void TestNextWorkingDay()
        {
            var thanksgiving = new DateTime(1999, 11, 25);
            var result       = new USAPublicHoliday().NextWorkingDay(thanksgiving);

            Assert.AreEqual(new DateTime(1999, 11, 26), result);
        }
Example #8
0
        public void TestMartinLutherKing2004()
        {
            var expected = new DateTime(2004, 1, 19);
            var actual   = USAPublicHoliday.MartinLutherKing(2004);

            Assert.AreEqual(expected, actual);
        }
Example #9
0
        public void TestIsPublicHoliday()
        {
            var thanksgiving = new DateTime(1999, 11, 25);
            var result       = new USAPublicHoliday().IsPublicHoliday(thanksgiving);

            Assert.IsTrue(result);
        }
Example #10
0
        public void TestNewYear2004()
        {
            var expected = new DateTime(2004, 1, 1);
            var actual   = USAPublicHoliday.NewYear(2004);

            Assert.AreEqual(expected, actual);
        }
        public void TestUSAHolidayThreeYearDateRange()
        {
            var holidayCalendar = new USAPublicHoliday();
            var actual          = holidayCalendar.GetHolidaysInDateRange(new DateTime(2015, 1, 2), new DateTime(2017, 12, 25));

            Assert.AreEqual(actual.Count, 29);
        }
Example #12
0
        public void TestColumbus2004()
        {
            var expected = new DateTime(2004, 10, 11);
            var actual   = USAPublicHoliday.ColumbusDay(2004);

            Assert.AreEqual(expected, actual);
        }
Example #13
0
        public void TestChristmas2004()
        {
            var expected = new DateTime(2004, 12, 24);
            var actual   = USAPublicHoliday.Christmas(2004);

            Assert.AreEqual(expected, actual);
        }
Example #14
0
        public void TestPublicHolidays()
        {
            var thanksgiving = new DateTime(1999, 11, 25);
            var result       = new USAPublicHoliday().PublicHolidays(1999);

            Assert.AreEqual(10, result.Count);
            Assert.IsTrue(result.Contains(thanksgiving));
        }
Example #15
0
        public void TestPublicHolidayInformation()
        {
            var usaPublicHoliday = new USAPublicHoliday();
            var hols             = usaPublicHoliday.PublicHolidays(2017);
            var infos            = usaPublicHoliday.PublicHolidaysInformation(2017);

            Assert.AreEqual(hols.Count, infos.Count);
            foreach (var info in infos)
            {
                Assert.IsTrue(hols.Contains(info), "observed date is implicitly in both lists");
            }
        }
Example #16
0
        public void TestNextWorkingDayColumbus()
        {
            var result = new USAPublicHoliday().NextWorkingDay(new DateTime(2006, 10, 8));

            Assert.AreEqual(new DateTime(2006, 10, 10), result);
        }
Example #17
0
        public void TestUSAHolidayIsWorkingDay()
        {
            var result = new USAPublicHoliday().IsWorkingDay(new DateTime(2019, 7, 15));

            Assert.IsTrue(result);
        }
Example #18
0
        public void TestUSAHolidayIsNotWorkingDay()
        {
            var result = new USAPublicHoliday().IsWorkingDay(new DateTime(2019, 7, 20));

            Assert.IsFalse(result);
        }