public void Test_AutoStartOrderProcedure() { Order order = TestOrderFactory.CreateOrder(2, 2, true); // put the order in progress Procedure rp = CollectionUtils.FirstElement(order.Procedures); ProcedureStep step = CollectionUtils.FirstElement(rp.ProcedureSteps); step.Start(TestStaffFactory.CreateStaff(new StaffTypeEnum("STEC", null, null))); // procedure is in progress CheckStatus(ProcedureStatus.IP, rp); Assert.IsNotNull(rp.StartTime); // order is in progress CheckStatus(OrderStatus.IP, order); Assert.IsNotNull(order.StartTime); }
public void Test_CancelOrderFromInProgress() { Order order = TestOrderFactory.CreateOrder(2, 2, true); // put the order in progress Procedure rp = CollectionUtils.FirstElement(order.Procedures); ProcedureStep step = CollectionUtils.FirstElement(rp.ProcedureSteps); step.Start(TestStaffFactory.CreateStaff(new StaffTypeEnum("STEC", null, null))); try { order.Cancel(new OrderCancelInfo(_defaultCancelReason, TestStaffFactory.CreateStaff(new StaffTypeEnum("SCLR", null, null)), "", null)); Assert.Fail("expected exception when trying to cancel non-scheduled order"); } catch (Exception e) { Assert.IsInstanceOfType(typeof(WorkflowException), e); } }