public void TestSetup() { _qnaApiClient = new Mock <IInternalQnaApiClient>(); _assessorSequenceService = new Mock <IAssessorSequenceService>(); _assessorLookupService = new AssessorLookupService(); _assessorPageService = new AssessorPageService(_qnaApiClient.Object, _assessorSequenceService.Object, _assessorLookupService); _assessorSequenceService.Setup(x => x.IsValidSequenceNumber(It.IsAny <int>())).Returns(true); var section = new ApplicationSection { ApplicationId = _applicationId, SequenceId = _sequenceNumber, SectionId = _sectionNumber, QnAData = new QnAData { Pages = new List <Page> { GenerateQnAPage(_firstPageId), GenerateQnAPage(_lastPageId) } } }; _qnaApiClient.Setup(x => x.GetSectionBySectionNo(section.ApplicationId, section.SequenceId, section.SectionId)).ReturnsAsync(section); _qnaApiClient.Setup(x => x.SkipPageBySectionNo(section.ApplicationId, section.SequenceId, section.SectionId, _firstPageId)).ReturnsAsync(new SkipPageResponse { NextAction = NextAction.NextPage, NextActionId = _lastPageId }); _qnaApiClient.Setup(x => x.SkipPageBySectionNo(section.ApplicationId, section.SequenceId, section.SectionId, _lastPageId)).ReturnsAsync(new SkipPageResponse { NextAction = NextAction.ReturnToSection }); }
public void TestSetup() { _mediator = new Mock <IMediator>(); _qnaApiClient = new Mock <IInternalQnaApiClient>(); _assessorSequenceService = new Mock <IAssessorSequenceService>(); _assessorLookupService = new AssessorLookupService(); _assessorPageService = new AssessorPageService(_mediator.Object, _qnaApiClient.Object, _assessorSequenceService.Object, _assessorLookupService); _mediator.Setup(x => x.Send(It.Is <GetBlindAssessmentOutcomeRequest>(r => r.ApplicationId == _applicationId && r.SequenceNumber == _sequenceNumber && r.SectionNumber == _sectionNumber), It.IsAny <CancellationToken>())).ReturnsAsync(new BlindAssessmentOutcome()); _assessorSequenceService.Setup(x => x.IsValidSequenceNumber(It.IsAny <int>())).Returns(true); var finanicialSection = new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.FinancialEvidence, SectionId = RoatpWorkflowSectionIds.FinancialEvidence.YourOrganisationsFinancialEvidence, QnAData = new QnAData { Pages = new List <Page> { GenerateFinanicialQnAPage() } } }; _qnaApiClient.Setup(x => x.GetSectionBySectionNo(finanicialSection.ApplicationId, finanicialSection.SequenceId, finanicialSection.SectionId)).ReturnsAsync(finanicialSection); var section = new ApplicationSection { ApplicationId = _applicationId, SequenceId = _sequenceNumber, SectionId = _sectionNumber, QnAData = new QnAData { Pages = new List <Page> { GenerateQnAPage(_firstPageId), GenerateQnAPage(_middlePageId), GenerateQnAPage(_lastPageId) } } }; _qnaApiClient.Setup(x => x.GetSectionBySectionNo(section.ApplicationId, section.SequenceId, section.SectionId)).ReturnsAsync(section); _qnaApiClient.Setup(x => x.SkipPageBySectionNo(section.ApplicationId, section.SequenceId, section.SectionId, _firstPageId)).ReturnsAsync(new SkipPageResponse { NextAction = NextAction.NextPage, NextActionId = _middlePageId }); _qnaApiClient.Setup(x => x.SkipPageBySectionNo(section.ApplicationId, section.SequenceId, section.SectionId, _middlePageId)).ReturnsAsync(new SkipPageResponse { NextAction = NextAction.NextPage, NextActionId = _lastPageId }); _qnaApiClient.Setup(x => x.SkipPageBySectionNo(section.ApplicationId, section.SequenceId, section.SectionId, _lastPageId)).ReturnsAsync(new SkipPageResponse { NextAction = NextAction.ReturnToSection }); }
public void TestSetup() { _assessorLookupService = new AssessorLookupService(); }
public void TestSetup() { _mediator = new Mock <IMediator>(); _qnaApiClient = new Mock <IInternalQnaApiClient>(); _lookupService = new AssessorLookupService(); _sequenceService = new AssessorSequenceService(_mediator.Object, _qnaApiClient.Object, _lookupService); var application = new Apply { ApplicationId = _applicationId, ApplyData = new ApplyData { Sequences = new List <ApplySequence> { new ApplySequence { SequenceNo = RoatpWorkflowSequenceIds.Preamble }, new ApplySequence { SequenceNo = RoatpWorkflowSequenceIds.YourOrganisation }, new ApplySequence { SequenceNo = RoatpWorkflowSequenceIds.FinancialEvidence }, new ApplySequence { SequenceNo = RoatpWorkflowSequenceIds.CriminalComplianceChecks }, new ApplySequence { SequenceNo = RoatpWorkflowSequenceIds.ProtectingYourApprentices }, new ApplySequence { SequenceNo = RoatpWorkflowSequenceIds.ReadinessToEngage }, new ApplySequence { SequenceNo = RoatpWorkflowSequenceIds.PlanningApprenticeshipTraining }, new ApplySequence { SequenceNo = RoatpWorkflowSequenceIds.DeliveringApprenticeshipTraining }, new ApplySequence { SequenceNo = RoatpWorkflowSequenceIds.EvaluatingApprenticeshipTraining }, new ApplySequence { SequenceNo = RoatpWorkflowSequenceIds.Finish } } } }; _mediator.Setup(x => x.Send(It.Is <GetApplicationRequest>(y => y.ApplicationId == _applicationId), It.IsAny <CancellationToken>())).ReturnsAsync(application); var allSections = new List <ApplicationSection> { new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.Preamble, SectionId = 1 }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.YourOrganisation, SectionId = RoatpWorkflowSectionIds.YourOrganisation.WhatYouWillNeed }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.YourOrganisation, SectionId = RoatpWorkflowSectionIds.YourOrganisation.OrganisationDetails }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.FinancialEvidence, SectionId = RoatpWorkflowSectionIds.FinancialEvidence.WhatYouWillNeed }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.FinancialEvidence, SectionId = RoatpWorkflowSectionIds.FinancialEvidence.YourOrganisationsFinancialEvidence }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.CriminalComplianceChecks, SectionId = RoatpWorkflowSectionIds.CriminalComplianceChecks.WhatYouWillNeed }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.CriminalComplianceChecks, SectionId = RoatpWorkflowSectionIds.CriminalComplianceChecks.ChecksOnYourOrganisation }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.ProtectingYourApprentices, SectionId = 1 }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.ProtectingYourApprentices, SectionId = 2 }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.ReadinessToEngage, SectionId = 1 }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.ReadinessToEngage, SectionId = 2 }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.PlanningApprenticeshipTraining, SectionId = 1 }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.PlanningApprenticeshipTraining, SectionId = 2 }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.DeliveringApprenticeshipTraining, SectionId = 1 }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.DeliveringApprenticeshipTraining, SectionId = 2 }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.EvaluatingApprenticeshipTraining, SectionId = 1 }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.EvaluatingApprenticeshipTraining, SectionId = 2 }, new ApplicationSection { ApplicationId = _applicationId, SequenceId = RoatpWorkflowSequenceIds.Finish, SectionId = 1 } }; _qnaApiClient.Setup(x => x.GetAllApplicationSections(_applicationId)).ReturnsAsync(allSections); }