public void check_office_for_students_details_are_returned(string returnedAnswer, bool expectedResult)
        {
            ExperienceAndAccreditationApiClient.Setup(x => x.GetOfficeForStudents(ApplicationId)).ReturnsAsync(returnedAnswer);

            var request  = new GetOfficeForStudentsRequest(ApplicationId, UserId, UserName);
            var response = Orchestrator.GetOfficeForStudentsViewModel(request);

            var viewModel = response.Result;

            Assert.AreEqual(GatewayPageIds.OfficeForStudents, viewModel.PageId);
            AssertCommonDetails(viewModel);
            Assert.AreEqual(expectedResult, viewModel.IsOrganisationFundedByOfficeForStudents);
        }
        public void check_subcontractor_contract_file_is_returned()
        {
            var fileStreamResult = new FileStreamResult(new MemoryStream(), "application/pdf");

            ExperienceAndAccreditationApiClient.Setup(x => x.GetSubcontractorDeclarationContractFile(ApplicationId)).ReturnsAsync(fileStreamResult);

            var request  = new GetSubcontractorDeclarationContractFileRequest(ApplicationId);
            var response = Orchestrator.GetSubcontractorDeclarationContractFile(request);

            var result = response.Result;

            Assert.AreSame(fileStreamResult, result);
        }
        public void check_subcontractor_declaration_details_are_returned()
        {
            var subcontractorDeclaration = new SubcontractorDeclaration {
                HasDeliveredTrainingAsSubcontractor = true, ContractFileName = "fileName"
            };

            ExperienceAndAccreditationApiClient.Setup(x => x.GetSubcontractorDeclaration(ApplicationId)).ReturnsAsync(subcontractorDeclaration);

            var request  = new GetSubcontractorDeclarationRequest(ApplicationId, UserId, UserName);
            var response = Orchestrator.GetSubcontractorDeclarationViewModel(request);

            var viewModel = response.Result;

            Assert.AreEqual(GatewayPageIds.SubcontractorDeclaration, viewModel.PageId);
            AssertCommonDetails(viewModel);
            Assert.AreEqual(subcontractorDeclaration.HasDeliveredTrainingAsSubcontractor, viewModel.HasDeliveredTrainingAsSubcontractor);
            Assert.AreEqual(subcontractorDeclaration.ContractFileName, viewModel.ContractFileName);
        }
        public void check_initial_teacher_training_details_are_returned()
        {
            var initialTeacherTraining = new InitialTeacherTraining {
                DoesOrganisationOfferInitialTeacherTraining = true, IsPostGradOnlyApprenticeship = false
            };

            ExperienceAndAccreditationApiClient.Setup(x => x.GetInitialTeacherTraining(ApplicationId)).ReturnsAsync(initialTeacherTraining);

            var request  = new GetInitialTeacherTrainingRequest(ApplicationId, UserId, UserName);
            var response = Orchestrator.GetInitialTeacherTrainingViewModel(request);

            var viewModel = response.Result;

            Assert.AreEqual(GatewayPageIds.InitialTeacherTraining, viewModel.PageId);
            AssertCommonDetails(viewModel);
            Assert.AreEqual(initialTeacherTraining.DoesOrganisationOfferInitialTeacherTraining, viewModel.DoesOrganisationOfferInitialTeacherTraining);
            Assert.AreEqual(initialTeacherTraining.IsPostGradOnlyApprenticeship, viewModel.IsPostGradOnlyApprenticeship);
        }
示例#5
0
        public void check_ofsted_details_are_returned()
        {
            var ofstedDetails = new OfstedDetails
            {
                FullInspectionApprenticeshipGrade       = "Pass",
                FullInspectionOverallEffectivenessGrade = "Fail",
                GradeWithinTheLast3Years = true,
                HasHadFullInspection     = false,
                HasHadMonitoringVisit    = true,
                HasHadShortInspectionWithinLast3Years            = false,
                HasMaintainedFullGradeInShortInspection          = true,
                HasMaintainedFundingSinceInspection              = false,
                ReceivedFullInspectionGradeForApprenticeships    = true,
                Has2MonitoringVisitsGradedInadequate             = false,
                HasMonitoringVisitGradedInadequateInLast18Months = true
            };

            ExperienceAndAccreditationApiClient.Setup(x => x.GetOfstedDetails(ApplicationId)).ReturnsAsync(ofstedDetails);

            var request  = new GetOfstedDetailsRequest(ApplicationId, UserId, UserName);
            var response = Orchestrator.GetOfstedDetailsViewModel(request);

            var viewModel = response.Result;

            Assert.AreEqual(GatewayPageIds.Ofsted, viewModel.PageId);
            AssertCommonDetails(viewModel);

            Assert.AreEqual(ofstedDetails.FullInspectionApprenticeshipGrade, viewModel.FullInspectionApprenticeshipGrade);
            Assert.AreEqual(ofstedDetails.FullInspectionOverallEffectivenessGrade, viewModel.FullInspectionOverallEffectivenessGrade);
            Assert.AreEqual(ofstedDetails.GradeWithinTheLast3Years, viewModel.GradeWithinTheLast3Years);
            Assert.AreEqual(ofstedDetails.HasHadFullInspection, viewModel.HasHadFullInspection);
            Assert.AreEqual(ofstedDetails.HasHadMonitoringVisit, viewModel.HasHadMonitoringVisit);
            Assert.AreEqual(ofstedDetails.HasHadShortInspectionWithinLast3Years, viewModel.HasHadShortInspectionWithinLast3Years);
            Assert.AreEqual(ofstedDetails.HasMaintainedFullGradeInShortInspection, viewModel.HasMaintainedFullGradeInShortInspection);
            Assert.AreEqual(ofstedDetails.HasMaintainedFundingSinceInspection, viewModel.HasMaintainedFundingSinceInspection);
            Assert.AreEqual(ofstedDetails.ReceivedFullInspectionGradeForApprenticeships, viewModel.ReceivedFullInspectionGradeForApprenticeships);
            Assert.AreEqual(ofstedDetails.Has2MonitoringVisitsGradedInadequate, viewModel.Has2MonitoringVisitsGradedInadequate);
            Assert.AreEqual(ofstedDetails.HasMonitoringVisitGradedInadequateInLast18Months, viewModel.HasMonitoringVisitGradedInadequateInLast18Months);
        }