Exemplo n.º 1
0
        public void ScheduleEveryMonthOn_ExceptionTest()
        {
            var today = DateTime.Now;
            var dueAt = today.AddSeconds(-10).TimeOfDay;
            var startDate = today.AddMonths(3);
            var endDate = startDate.AddMonths(4);

            var day = 28;
            MonthlySchedule ms = new MonthlySchedule(dueAt, startDate, endDate);
            ms.ScheduleEveryMonthOnDay(day);
        }
Exemplo n.º 2
0
        public void ScheduleEveryMonthOn10Test()
        {
            DateTime today = DateTime.Now;
            var dueAt = today.AddSeconds(-10).TimeOfDay;
            var startDate = today.AddMonths(3);
            var endDate = startDate.AddMonths(4);

            var day = 10;
            MonthlySchedule ms = new MonthlySchedule(dueAt, startDate, endDate);
            ms.ScheduleEveryMonthOnDay(day);

            var expectedDateTime = GetComingDayOfTheMonth(startDate, day, dueAt);
            Assert.AreEqual(expectedDateTime, ms.DueDateTime);
        }