Beispiel #1
0
        public void HandleToDoTemplateRegistration_Status_Abandoned()
        {
            ToDoActivationRule rule = new ToDoActivationRule
            {
                EndpointUtil = new StubEndpointUtils(),
                PlanUtils    = new PlanElementUtils()
            };

            var patientId = ObjectId.GenerateNewId().ToString();

            PlanElementEventArg arg = new PlanElementEventArg
            {
                Program = new Program
                {
                    Id        = ObjectId.GenerateNewId().ToString(),
                    PatientId = patientId
                },
                UserId = "5325c821072ef705080d3488",
                Action = new Actions {
                    Id = ObjectId.GenerateNewId().ToString()
                },
                PatientId   = patientId,
                PlanElement = new Step()
            };

            var se = new SpawnElement
            {
                ElementType = 201,
                ElementId   = "53ff6b92d4332314bcab46e0"
            };

            var type = rule.Execute(arg.UserId, arg, se, new ProgramAttributeData());

            Assert.AreEqual(type, 200);
        }
            public void Execute_ToDo()
            {
                IElementActivationRule rule = new ToDoActivationRule
                {
                    EndpointUtil = new StubEndpointUtils(),
                    PlanUtils    = new NG.Fakes.StubIPlanElementUtils()
                };
                SpawnElement se = new NG.DTO.Fakes.StubSpawnElement {
                    ElementType = 111
                };
                PlanElementEventArg arg = new NG.PlanCOR.Fakes.StubPlanElementEventArg {
                };
                var userid = "999999999999999999999999";
                var result = rule.Execute(userid, arg, se, new ProgramAttributeData());

                Assert.AreEqual(result, "ToDo");
            }