public void Test_CanExecute() { Order order = new Order(); CancelOrderOperation op = new CancelOrderOperation(); Assert.AreEqual(OrderStatus.SC, order.Status); Assert.IsTrue(op.CanExecute(order)); }
public void Test_CanExecute_Cancel() { Order order = new Order(); CancelOrderOperation op = new CancelOrderOperation(); order.Cancel(new OrderCancelInfo()); order.UpdateStatus(); Assert.AreEqual(OrderStatus.CA, order.Status); Assert.IsFalse(op.CanExecute(order)); }
public void Test_CanExecute_InProgress() { Order order = new Order(); CancelOrderOperation op = new CancelOrderOperation(); Procedure procedure = new Procedure(); ModalityProcedureStep step = new ModalityProcedureStep(procedure, "New modality.", new Healthcare.Modality()); order.AddProcedure(procedure); step.Start(new Staff()); Assert.AreEqual(OrderStatus.IP, order.Status); Assert.IsFalse(op.CanExecute(order)); }
public void Test_CanExecute_Discontinue() { Order order = new Order(); CancelOrderOperation op = new CancelOrderOperation(); Procedure procedure = new Procedure(); ModalityProcedureStep step = new ModalityProcedureStep(procedure, "New modality.", new Healthcare.Modality()); order.AddProcedure(procedure); step.Start(new Staff()); order.Discontinue(new OrderCancelInfo()); Assert.AreEqual(OrderStatus.DC, order.Status); Assert.IsFalse(op.CanExecute(order)); }
public void Test_CanExecute_Complete() { Order order = new Order(); CancelOrderOperation op = new CancelOrderOperation(); Procedure procedure = new Procedure(); ModalityProcedureStep step = new ModalityProcedureStep(procedure, "New modality.", new Healthcare.Modality()); order.AddProcedure(procedure); step.Start(new Staff()); procedure.Complete(DateTime.Now); order.UpdateStatus(); Assert.AreEqual(OrderStatus.CM, order.Status); Assert.IsFalse(op.CanExecute(order)); }