public ApplicationProcessOrchestratorTestsFixture()
 {
     MockClient = new Mock <IEmployerVacancyClient>();
     MockRecruitVacancyClient = new Mock <IRecruitVacancyClient>();
     User    = VacancyOrchestratorTestData.GetVacancyUser();
     Vacancy = VacancyOrchestratorTestData.GetPart1CompleteVacancy();
 }
        public void WhenApplicationMethodIsThroughFaaVacancy_ShouldOverwriteApplicationInstructionsAsNull()
        {
            var user    = VacancyOrchestratorTestData.GetVacancyUser();
            var vacancy = VacancyOrchestratorTestData.GetPart1CompleteVacancy();

            _mockVacancyClient.Setup(x => x.GetVacancyAsync(vacancy.Id))
            .ReturnsAsync(vacancy);
            _mockVacancyClient.Setup(x => x.Validate(vacancy, VacancyRuleSet.ApplicationMethod))
            .Returns(new EntityValidationResult());
            _mockVacancyClient.Setup(x => x.UpdateDraftVacancyAsync(It.IsAny <Vacancy>(), user));

            var sut = new ApplicationProcessOrchestrator(_mockClient.Object, _mockVacancyClient.Object, Options.Create(new ExternalLinksConfiguration()), Mock.Of <ILogger <ApplicationProcessOrchestrator> >(), Mock.Of <IReviewSummaryService>());

            var applicationProcessEditModel = new ApplicationProcessEditModel
            {
                EmployerAccountId       = vacancy.EmployerAccountId,
                VacancyId               = vacancy.Id,
                ApplicationMethod       = ApplicationMethod.ThroughFindAnApprenticeship,
                ApplicationInstructions = "just do it"
            };

            var result = sut.PostApplicationProcessEditModelAsync(applicationProcessEditModel, user);

            vacancy.ApplicationMethod.HasValue.Should().BeTrue();
            vacancy.ApplicationMethod.Value.Should().Be(ApplicationMethod.ThroughFindAnApprenticeship);
            vacancy.ApplicationInstructions.Should().BeNull();
            _mockVacancyClient.Verify(x => x.UpdateDraftVacancyAsync(vacancy, user), Times.Once);
        }
            public EmployerContactDetailsOrchestratorTestsFixture()
            {
                MockClient = new Mock <IEmployerVacancyClient>();
                MockRecruitVacancyClient = new Mock <IRecruitVacancyClient>();

                User    = VacancyOrchestratorTestData.GetVacancyUser();
                Vacancy = VacancyOrchestratorTestData.GetPart1CompleteVacancy();
            }
コード例 #4
0
            public WageOrchestratorTestsFixture()
            {
                MockClient = new Mock <IProviderVacancyClient>();
                MockRecruitVacancyClient = new Mock <IRecruitVacancyClient>();

                User    = VacancyOrchestratorTestData.GetVacancyUser();
                Vacancy = VacancyOrchestratorTestData.GetPart1CompleteVacancy();
            }
コード例 #5
0
            public ShortDescriptionOrchestratorTestsFixture()
            {
                MockClient = new Mock <IEmployerVacancyClient>();
                MockRecruitVacancyClient = new Mock <IRecruitVacancyClient>();

                User    = VacancyOrchestratorTestData.GetVacancyUser();
                Vacancy = VacancyOrchestratorTestData.GetPart1CompleteVacancy();
            }
            public NumberofPositionsOrchestratorTestsFixture()
            {
                MockClient = new Mock <IEmployerVacancyClient>();
                MockRecruitVacancyClient = new Mock <IRecruitVacancyClient>();

                User    = VacancyOrchestratorTestData.GetVacancyUser();
                Vacancy = VacancyOrchestratorTestData.GetPart1CompleteVacancy();
            }
            public AboutEmployerOrchestratorTestsFixture()
            {
                MockClient = new Mock <IEmployerVacancyClient>();
                MockRecruitVacancyClient = new Mock <IRecruitVacancyClient>();

                User            = VacancyOrchestratorTestData.GetVacancyUser();
                Vacancy         = VacancyOrchestratorTestData.GetPart1CompleteVacancy();
                EmployerProfile = VacancyOrchestratorTestData.GetEmployerProfile(Vacancy.AccountLegalEntityPublicHashedId);
            }
コード例 #8
0
            public LocationOrchestratorTestsFixture()
            {
                MockClient = new Mock <IEmployerVacancyClient>();
                MockRecruitVacancyClient = new Mock <IRecruitVacancyClient>();
                MockAddressesClient      = new Mock <IGetAddressesClient>();

                User    = VacancyOrchestratorTestData.GetVacancyUser();
                Vacancy = VacancyOrchestratorTestData.GetPart1CompleteVacancy();
                VacancyEmployerProfile   = VacancyOrchestratorTestData.GetEmployerProfile(Vacancy.AccountLegalEntityPublicHashedId);
                AlternateEmployerProfile = VacancyOrchestratorTestData.GetEmployerProfile(VacancyOrchestratorTestData.AccountLegalEntityPublicHashedId456);
                AddressesListResponse    = VacancyOrchestratorTestData.GetAddressesListResponse();
                EmployerEditVacancyInfo  = VacancyOrchestratorTestData.GetEmployerEditVacancyInfo();
            }
            public TrainingProviderOrchestratorTestsFixture()
            {
                MockClient = new Mock <IEmployerVacancyClient>();
                MockRecruitVacancyClient            = new Mock <IRecruitVacancyClient>();
                MockTrainingProviderSummaryProvider = new Mock <ITrainingProviderSummaryProvider>();
                MockTrainingProviderService         = new Mock <ITrainingProviderService>();

                User = VacancyOrchestratorTestData.GetVacancyUser();

                TrainingProviderOne = new TrainingProvider {
                    Ukprn = 88888888
                };
                TrainingProviderTwo = new TrainingProvider {
                    Ukprn = 88888889
                };
                TrainingProviderSummaryOne = new TrainingProviderSummary {
                    ProviderName = "First Training Provider", Ukprn = TrainingProviderOne.Ukprn.Value
                };
                TrainingProviderSummaryTwo = new TrainingProviderSummary {
                    ProviderName = "Second Training Provider", Ukprn = TrainingProviderTwo.Ukprn.Value
                };
            }