예제 #1
0
        public void Test_CanExecute()
        {
            Order order             = new Order();
            CancelOrderOperation op = new CancelOrderOperation();

            Assert.AreEqual(OrderStatus.SC, order.Status);
            Assert.IsTrue(op.CanExecute(order));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
예제 #5
0
        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));
        }
예제 #6
0
        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));
        }
예제 #7
0
 public void Test_CanExecute()
 {
     Order order = new Order();
     CancelOrderOperation op = new CancelOrderOperation();
     
     Assert.AreEqual(OrderStatus.SC, order.Status);
     Assert.IsTrue(op.CanExecute(order));
 }