Ejemplo n.º 1
0
        public Action EditAction(string actionId, string assignedToId, string description, DateTimeOffset dueDate, string title, bool onHold, bool completed, Priority priority)
        {
            IQueryable <Action> queryableAction = _actionService.GetAction(actionId);
            Action action = queryableAction.First();

            Participant assignedTo = _participantService.GetParticipant(assignedToId);

            return(_actionService.EditAction(action, assignedTo, description, dueDate, title, onHold, completed, priority));
        }
Ejemplo n.º 2
0
        public Action EditAction(string actionId, string assignedToId, string description, DateTimeOffset dueDate, string title, bool onHold, bool completed, Priority priority)
        {
            IQueryable <Action> queryableAction = _actionService.GetAction(actionId);
            Action     action     = queryableAction.First();
            Evaluation evaluation = queryableAction.Select(q => q.Question.Evaluation).First();

            Role[] canBePerformedBy = { Role.Facilitator, Role.Participant, Role.OrganizationLead };
            AssertCanPerformMutation(evaluation, canBePerformedBy);

            Participant assignedTo = _participantService.GetParticipant(assignedToId);

            return(_actionService.EditAction(action, assignedTo, description, dueDate, title, onHold, completed, priority));
        }
Ejemplo n.º 3
0
        public void EditAction()
        {
            ParticipantService participantService = new ParticipantService(_context);
            Participant        participant        = participantService.GetAll().First();

            QuestionService questionService = new QuestionService(_context);
            Question        question        = questionService.GetAll().First();

            ActionService actionService      = new ActionService(_context);
            string        initialDescription = "initial description";
            Action        action             = actionService.Create(participant, participant, initialDescription, DateTimeOffset.UtcNow, "title", Priority.Medium, question);
            string        actionId           = action.Id;

            string newDescription = "new description";

            actionService.EditAction(action, participant, newDescription, DateTimeOffset.UtcNow, "title", false, false, Priority.High);

            Action resultingAction = actionService.GetAction(actionId).First();

            Assert.Equal(newDescription, resultingAction.Description);
        }