static void Main(string[] args) { TaskPlanner taskPlanner = new TaskPlanner(); var workdayStartTime = new TimeSpan(8, 0, 0); var workdayStopTime = new TimeSpan(16, 0, 0); taskPlanner.SetWorkdayStartAndStop(workdayStartTime, workdayStopTime); taskPlanner.SetRecurringHoliday(new DateTime(2004, 5, 17, 0, 0, 0)); taskPlanner.SetRecurringHoliday(new DateTime(2004, 5, 24, 0, 0, 0)); taskPlanner.SetHoliday(new DateTime(2004, 5, 27, 0, 0, 0)); var start = new DateTime(2004, 5, 24, 18, 5, 0); double numberOfDays = -5.5; var actual = taskPlanner.GetTaskFinishingDate(start, numberOfDays); Console.WriteLine("end: {0:f}", actual); }
static void Main(string[] args) { TaskPlanner taskPlanner = new TaskPlanner(); taskPlanner.SetWorkdayStartAndStop(new TimeSpan(8, 0, 0), new TimeSpan(16, 0, 0)); taskPlanner.SetRecurringHoliday(new DateTime(2004, 12, 11, 0, 0, 0)); taskPlanner.SetHoliday(new DateTime(2017, 12, 06, 0, 0, 0)); taskPlanner.SetRecurringHoliday(new DateTime(2004, 12, 7, 0, 0, 0)); taskPlanner.SetRecurringHoliday(new DateTime(2004, 5, 17, 0, 0, 0)); taskPlanner.SetHoliday(new DateTime(2004, 5, 27, 0, 0, 0)); taskPlanner.SetHoliday(new DateTime(2004, 5, 21, 0, 0, 0)); // Arrange var startDate = new DateTime(2017, 12, 11, 14, 00, 00); double days = -2.5; Console.WriteLine("end: {0:f}", taskPlanner.GetTaskFinishingDate(startDate, days)); Console.ReadLine(); }