public void Setup() { workdayCalendar = new WorkdayCalendar(); workdayCalendar.SetWorkDayStartAndStop(new TimeSpan(8, 0, 0), new TimeSpan(16, 0, 0)); workdayCalendar.SetHoliday(new DateTime(2004, 5, 17, 0, 0, 0), true); workdayCalendar.SetHoliday(new DateTime(2004, 5, 27, 0, 0, 0), false); }
public void OneWorkdayRequestFromMondayThuesdayIsHoliday() { var startDate = new DateTime(2015, 01, 20, 9, 0, 0); startDate = startDate.StartOfWeek(DayOfWeek.Monday); workdayCalendar.SetHoliday(startDate.AddDays(1), false); var incrementResult = workdayCalendar.GetWorkdayIncrement(startDate, 1); Assert.AreEqual(startDate.Date.Add(new TimeSpan(2, 9, 0, 0)).AsNumber(), incrementResult.AsNumber()); }