public void Test_RescheduleLater() { Order order = TestOrderFactory.CreateOrder(2, 2, true, true); DateTime originalTime = (DateTime)order.ScheduledStartTime; DateTime newTime = originalTime + TimeSpan.FromDays(1); Procedure rp = CollectionUtils.FirstElement(order.Procedures); ProcedureStep step = CollectionUtils.FirstElement(rp.ProcedureSteps); step.Schedule(newTime); Assert.AreEqual(newTime, step.Scheduling.StartTime); // verify order and rp scheduled time still reflect earliest time Assert.AreEqual(originalTime, rp.ScheduledStartTime); Assert.AreEqual(originalTime, order.ScheduledStartTime); }
public void Test_ScheduleProcedureStep() { // create an unscheduled order Order order = TestOrderFactory.CreateOrder(1, 1, true); DateTime scheduleTime = DateTime.Now; Procedure rp = CollectionUtils.FirstElement(order.Procedures); ProcedureStep step = CollectionUtils.FirstElement(rp.ProcedureSteps); step.Schedule(scheduleTime); Assert.AreEqual(scheduleTime, step.Scheduling.StartTime); // verify order and rp scheduled time are updated to reflect earliest time Assert.AreEqual(scheduleTime, rp.ScheduledStartTime); Assert.AreEqual(scheduleTime, order.ScheduledStartTime); }