Exemple #1
0
        private void HydrateSectorDetailsWithHowTrainingIsDeliveredDetails(AssessorPage pageHowDeliveredAndDuration,
                                                                           SectorQuestionIds sectorPageIds, AssessorSectorDetails sectorDetails)
        {
            if (pageHowDeliveredAndDuration?.Answers == null || !pageHowDeliveredAndDuration.Answers.Any())
            {
                return;
            }
            var howHaveTheyDelivered =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(pageHowDeliveredAndDuration.Answers,
                                                                            sectorPageIds.HowHaveTheyDeliveredTraining);

            var otherIsHowTheyDelivered =
                RoatpWorkflowPageIds.DeliveringApprenticeshipTraining.DeliveringTrainingOther;

            if (howHaveTheyDelivered.Contains(otherIsHowTheyDelivered))
            {
                var otherWords =
                    _extractAnswerValueService.ExtractAnswerValueFromQuestionId(pageHowDeliveredAndDuration.Answers,
                                                                                sectorPageIds.HowHaveTheyDeliveredTrainingOther);
                howHaveTheyDelivered = howHaveTheyDelivered.Replace(otherIsHowTheyDelivered, otherWords.Replace(",", ","));
            }

            sectorDetails.HowHaveTheyDeliveredTraining = howHaveTheyDelivered;

            sectorDetails.ExperienceOfDeliveringTraining =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(
                    pageHowDeliveredAndDuration.Answers, sectorPageIds.ExperienceOfDeliveringTraining);

            sectorDetails.TypicalDurationOfTraining = _extractAnswerValueService.ExtractAnswerValueFromQuestionId(
                pageHowDeliveredAndDuration.Answers, sectorPageIds.TypicalDurationOfTraining);
        }
Exemple #2
0
 private void HydrateSectorDetailsWithWhatStandardsOffered(AssessorPage pageWhatStandardsOffered, AssessorSectorDetails sectorDetails, SectorQuestionIds sectorPageIds)
 {
     if (pageWhatStandardsOffered?.Answers == null || !pageWhatStandardsOffered.Answers.Any())
     {
         return;
     }
     sectorDetails.WhatStandardsOffered = _extractAnswerValueService.ExtractAnswerValueFromQuestionId(pageWhatStandardsOffered.Answers,
                                                                                                      sectorPageIds.WhatStandardsOffered);
 }
Exemple #3
0
 private void HydrateSectorDetailsWhatTypeOfTrainingDelivered(AssessorSectorDetails sectorDetails,
                                                              AssessorPage pageTypeOfTraining, SectorQuestionIds sectorPageIds)
 {
     if (pageTypeOfTraining?.Answers == null || !pageTypeOfTraining.Answers.Any())
     {
         return;
     }
     sectorDetails.WhatTypeOfTrainingDelivered = _extractAnswerValueService.ExtractAnswerValueFromQuestionId(
         pageTypeOfTraining.Answers, sectorPageIds.WhatTypeOfTrainingDelivered);
 }
Exemple #4
0
        private void HydrateSectorDetailsWithQualificationsAwardingBodiesAndTradeMemberships(AssessorSectorDetails sectorDetails,
                                                                                             AssessorPage page5ExperienceQualificationsMemberships, SectorQuestionIds sectorPageIds)
        {
            if (page5ExperienceQualificationsMemberships?.Answers == null || !page5ExperienceQualificationsMemberships.Answers.Any())
            {
                return;
            }
            sectorDetails.ExperienceOfDelivering =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(
                    page5ExperienceQualificationsMemberships.Answers,
                    sectorPageIds.ExperienceOfDelivering);

            sectorDetails.WhereDidTheyGainThisExperience =
                _extractAnswerValueService.ExtractFurtherQuestionAnswerValueFromQuestionId(
                    page5ExperienceQualificationsMemberships,
                    sectorPageIds.ExperienceOfDelivering);

            sectorDetails.DoTheyHaveQualifications = _extractAnswerValueService.ExtractAnswerValueFromQuestionId(
                page5ExperienceQualificationsMemberships.Answers, sectorPageIds.DoTheyHaveQualifications);

            sectorDetails.WhatQualificationsDoTheyHave =
                _extractAnswerValueService.ExtractFurtherQuestionAnswerValueFromQuestionId(
                    page5ExperienceQualificationsMemberships,
                    sectorPageIds.DoTheyHaveQualifications);

            sectorDetails.ApprovedByAwardingBodies = _extractAnswerValueService.ExtractAnswerValueFromQuestionId(
                page5ExperienceQualificationsMemberships.Answers, sectorPageIds.AwardingBodies);

            sectorDetails.NamesOfAwardingBodies =
                _extractAnswerValueService.ExtractFurtherQuestionAnswerValueFromQuestionId(
                    page5ExperienceQualificationsMemberships,
                    sectorPageIds.AwardingBodies);


            sectorDetails.DoTheyHaveTradeBodyMemberships =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(
                    page5ExperienceQualificationsMemberships.Answers, sectorPageIds.TradeMemberships);

            sectorDetails.NamesOfTradeBodyMemberships =
                _extractAnswerValueService.ExtractFurtherQuestionAnswerValueFromQuestionId(
                    page5ExperienceQualificationsMemberships,
                    sectorPageIds.TradeMemberships);
        }
Exemple #5
0
        private void HydrateSectorDetailsWithFullNameJobRoleTimeInRole(AssessorPage page4NameRoleExperience,
                                                                       AssessorSectorDetails sectorDetails, SectorQuestionIds sectorPageIds)
        {
            if (page4NameRoleExperience?.Answers == null || !page4NameRoleExperience.Answers.Any())
            {
                return;
            }
            sectorDetails.FirstName =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(page4NameRoleExperience.Answers,
                                                                            sectorPageIds.FirstName);
            sectorDetails.LastName =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(page4NameRoleExperience.Answers,
                                                                            sectorPageIds.LastName);
            sectorDetails.JobRole =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(page4NameRoleExperience.Answers,
                                                                            sectorPageIds.JobRole);
            sectorDetails.TimeInRole =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(page4NameRoleExperience.Answers,
                                                                            sectorPageIds.TimeInRole);

            sectorDetails.IsPartOfAnyOtherOrganisations =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(page4NameRoleExperience.Answers,
                                                                            sectorPageIds.IsPartOfAnyOtherOrganisations);

            sectorDetails.OtherOrganisations = _extractAnswerValueService.ExtractFurtherQuestionAnswerValueFromQuestionId(page4NameRoleExperience,
                                                                                                                          sectorPageIds.IsPartOfAnyOtherOrganisations);
            var dateOfBirth =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(page4NameRoleExperience.Answers,
                                                                            sectorPageIds.DateOfBirth);

            sectorDetails.DateOfBirth = DateOfBirthFormatter.GetMonthYearDescription(dateOfBirth);
            sectorDetails.Email       =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(page4NameRoleExperience.Answers,
                                                                            sectorPageIds.Email);
            sectorDetails.ContactNumber =
                _extractAnswerValueService.ExtractAnswerValueFromQuestionId(page4NameRoleExperience.Answers,
                                                                            sectorPageIds.ContactNumber);
        }
Exemple #6
0
 private void HydrateSectorDetailsWithHowManyEmployees(AssessorPage pageHowManyEmployees, AssessorSectorDetails sectorDetails, SectorQuestionIds sectorPageIds)
 {
     if (pageHowManyEmployees?.Answers == null || !pageHowManyEmployees.Answers.Any())
     {
         return;
     }
     sectorDetails.HowManyEmployees = _extractAnswerValueService.ExtractAnswerValueFromQuestionId(pageHowManyEmployees.Answers,
                                                                                                  sectorPageIds.HowManyEmployees);
 }
Exemple #7
0
        public void TestSetup()
        {
            _assessorPageService       = new Mock <IAssessorPageService>();
            _assessorLookupService     = new Mock <IAssessorLookupService>();
            _extractAnswerValueService = new Mock <IExtractAnswerValueService>();
            _sectorQuestionIds         = new SectorQuestionIds();

            _assessorPageService.Setup(x => x.GetPage(_applicationId, _sequenceId, _sectionId, _firstPageId))
            .ReturnsAsync(new AssessorPage {
                PageId = _firstPageId, Answers = new List <AssessorAnswer> {
                    new AssessorAnswer()
                }, NextPageId = _secondPageId
            });
            _assessorPageService.Setup(x => x.GetPage(_applicationId, _sequenceId, _sectionId, _secondPageId))
            .ReturnsAsync(new AssessorPage {
                PageId = _secondPageId, Answers = new List <AssessorAnswer> {
                    new AssessorAnswer()
                }, NextPageId = _thirdPageId
            });
            _assessorPageService.Setup(x => x.GetPage(_applicationId, _sequenceId, _sectionId, _thirdPageId))
            .ReturnsAsync(new AssessorPage {
                PageId = _thirdPageId, Answers = new List <AssessorAnswer> {
                    new AssessorAnswer()
                }, NextPageId = _fourthPageId
            });
            _assessorPageService.Setup(x => x.GetPage(_applicationId, _sequenceId, _sectionId, _fourthPageId))
            .ReturnsAsync(new AssessorPage {
                PageId = _fourthPageId, Answers = new List <AssessorAnswer> {
                    new AssessorAnswer()
                }, NextPageId = _fifthPageId
            });
            _assessorPageService.Setup(x => x.GetPage(_applicationId, _sequenceId, _sectionId, _fifthPageId))
            .ReturnsAsync(new AssessorPage {
                PageId = _fifthPageId, Answers = new List <AssessorAnswer> {
                    new AssessorAnswer()
                }, NextPageId = _sixthPageId
            });

            _assessorPageService.Setup(x => x.GetPage(_applicationId, _sequenceId, _sectionId, _sixthPageId))
            .ReturnsAsync(new AssessorPage {
                PageId = _sixthPageId, Answers = new List <AssessorAnswer> {
                    new AssessorAnswer()
                }, NextPageId = _seventhPageId
            });

            _assessorPageService.Setup(x => x.GetPage(_applicationId, _sequenceId, _sectionId, _seventhPageId))
            .ReturnsAsync(new AssessorPage {
                PageId = _seventhPageId, Answers = new List <AssessorAnswer> {
                    new AssessorAnswer()
                }
            });
            _assessorLookupService.Setup(x => x.GetSectorQuestionIdsForSectorPageId(It.IsAny <string>())).Returns(_sectorQuestionIds);

            _sectorQuestionIds.HowHaveTheyDeliveredTraining = "HowHaveTheyDeliveredId";
            var howHaveTheyDelivered = "delivery mechanism";

            _extractAnswerValueService
            .Setup(a => a.ExtractAnswerValueFromQuestionId(It.IsAny <List <AssessorAnswer> >(), _sectorQuestionIds.HowHaveTheyDeliveredTraining))
            .Returns(howHaveTheyDelivered);
            _service = new AssessorSectorDetailsService(_assessorLookupService.Object, _assessorPageService.Object, _extractAnswerValueService.Object);
        }