Example #1
0
        public void GetTomorrowWeekHoliday()
        {
            var dateReference    = new DateTime(2014, 12, 31);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(Convert.ToDateTime("2015-01-02"), managementHelper.GetTomorrow(Convert.ToDateTime("2014-12-31")));
        }
Example #2
0
        public void GetTomorrowWeekend()
        {
            var dateReference    = new DateTime(2015, 08, 11);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(Convert.ToDateTime("2015-08-17"), managementHelper.GetTomorrow(Convert.ToDateTime("2015-08-14")));
        }
Example #3
0
        public void GetTomorrowWeekendThenHoliday()
        {
            var dateReference    = new DateTime(2015, 04, 03);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(Convert.ToDateTime("2015-04-07"), managementHelper.GetTomorrow(Convert.ToDateTime("2015-04-03")));
        }
Example #4
0
        public void GetSpanDays1YearSunday()
        {
            var dateReference    = new DateTime(2014, 11, 22);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(366.00, managementHelper.GetSpanDays(dateReference, dateReference.AddYears(1) - dateReference));
        }
Example #5
0
        public void GetTomorrowTomorrowHolidayPuisWeekend()
        {
            var dateReference    = new DateTime(2015, 04, 30);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(Convert.ToDateTime("2015-05-04"), managementHelper.GetTomorrow(Convert.ToDateTime("2015-04-30")));
        }
Example #6
0
        public void GetLastNoHoliday()
        {
            var dateReference    = new DateTime(2015, 01, 13);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(Convert.ToDateTime("2015-01-13"), managementHelper.GetLast(dateReference));
        }
Example #7
0
        public void GetLast2Holidays2()
        {
            var dateReference    = new DateTime(2016, 01, 04);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(Convert.ToDateTime("2016-01-04"), managementHelper.GetLast(dateReference));
        }
Example #8
0
        public void GetSpanStartWeekEnd()
        {
            var dureeStock       = new TimeSpan(-7, 0, 0, 0);
            var dateReference    = new DateTime(2015, 01, 12);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(Convert.ToDateTime("2015-01-05"), managementHelper.GetSpanStart(dateReference, dureeStock));
        }
Example #9
0
        public void GetSpanStart3Holiday()
        {
            var dureeStock       = new TimeSpan(-7, 0, 0, 0);
            var dateReference    = new DateTime(2015, 01, 02);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(Convert.ToDateTime("2014-12-26"), managementHelper.GetSpanStart(dateReference, dureeStock));
        }
Example #10
0
        public void GetSpanEndWeekEnd()
        {
            var dureeStock       = new TimeSpan(7, 0, 0, 0);
            var dateReference    = new DateTime(2016, 04, 08);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(Convert.ToDateTime("2016-04-15"), managementHelper.GetSpanEnd(dateReference, dureeStock));
        }
Example #11
0
        public void GetSpanEndNoHoliday()
        {
            var dureeStock       = new TimeSpan(7, 0, 0, 0);
            var dateReference    = new DateTime(2015, 01, 13);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(Convert.ToDateTime("2015-01-20"), managementHelper.GetSpanEnd(dateReference, dureeStock));
        }
Example #12
0
        public void GetSpanEnd2Holidays1()
        {
            var dureeStock       = new TimeSpan(7, 0, 0, 0);
            var dateReference    = new DateTime(2016, 03, 24);
            var managementHelper = UtilsHelper.CreateDateManagementHelper();

            Assert.AreEqual(Convert.ToDateTime("2016-03-31"), managementHelper.GetSpanEnd(dateReference, dureeStock));
        }