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
            });
        }
示例#2
0
        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
            });
        }