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

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

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

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

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

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

            Assert.AreEqual(expected, actual);
        }
예제 #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);
        }
예제 #8
0
        public void TestMartinLutherKing2004()
        {
            var expected = new DateTime(2004, 1, 19);
            var actual   = USAPublicHoliday.MartinLutherKing(2004);

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

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

            Assert.AreEqual(expected, actual);
        }
예제 #11
0
        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);
        }
예제 #12
0
        public void TestColumbus2004()
        {
            var expected = new DateTime(2004, 10, 11);
            var actual   = USAPublicHoliday.ColumbusDay(2004);

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

            Assert.AreEqual(expected, actual);
        }
예제 #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));
        }
예제 #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");
            }
        }
예제 #16
0
        public void TestNextWorkingDayColumbus()
        {
            var result = new USAPublicHoliday().NextWorkingDay(new DateTime(2006, 10, 8));

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

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

            Assert.IsFalse(result);
        }