public Evaluation ProgressEvaluation(string evaluationId, Progression newProgression) { _authService.AssertIsFacilitator(evaluationId); Evaluation evaluation = _evaluationService.GetEvaluation(evaluationId); _evaluationService.ProgressEvaluation(evaluation, newProgression); _participantService.ProgressAllParticipants(evaluation, newProgression); if (newProgression.Equals(Progression.FollowUp)) { _answerService.CreateFollowUpAnswers(evaluation); } return(evaluation); }
public Evaluation ProgressEvaluation(string evaluationId, Progression newProgression) { Evaluation evaluation = _evaluationService.GetEvaluation(evaluationId); Role[] canBePerformedBy = { Role.Facilitator }; AssertCanPerformMutation(evaluation, canBePerformedBy); _evaluationService.ProgressEvaluation(evaluation, newProgression); _participantService.ProgressAllParticipants(evaluation, newProgression); if (newProgression.Equals(Progression.FollowUp)) { _evaluationService.SetWorkshopCompleteDate(evaluation); _answerService.CreateFollowUpAnswers(evaluation); } return(evaluation); }
public void ProgressAllParticipants() { ProjectService projectService = new ProjectService(_context); ParticipantService participantService = new ParticipantService(_context); EvaluationService evaluationService = new EvaluationService(_context); Project project = projectService.Create("ProgressAllParticipants"); Evaluation evaluation = evaluationService.Create("ProgressAllParticipants", project); Participant participant1 = participantService.Create("ProgressAllParticipants1", evaluation, Organization.All, Role.Facilitator); Participant participant2 = participantService.Create("ProgressAllParticipants2", evaluation, Organization.Commissioning, Role.OrganizationLead); Progression progression1Before = participant1.Progression; participantService.ProgressAllParticipants(evaluation, Progression.Individual); Progression progression1After = participant1.Progression; Progression progression2After = participant2.Progression; Assert.Equal(Progression.Nomination, progression1Before); Assert.Equal(Progression.Individual, progression1After); Assert.Equal(Progression.Individual, progression2After); }