예제 #1
0
        public async Task <IActionResult> Considerations(ConsiderationsEditModel m)
        {
            var response = await _orchestrator.PostConsiderationsEditModelAsync(m, User.ToVacancyUser());

            if (!response.Success)
            {
                response.AddErrorsToModelState(ModelState);
            }

            var vm = await _orchestrator.GetConsiderationsViewModelAsync(m);

            if (!ModelState.IsValid)
            {
                return(View(vm));
            }

            if (_feature.IsFeatureEnabled(FeatureNames.EmployerTaskList))
            {
                if (!vm.IsTaskListCompleted)
                {
                    return(RedirectToRoute(RouteNames.EmployerTaskListGet));
                }
                return(RedirectToRoute(RouteNames.EmployerCheckYourAnswersGet));
            }

            return(RedirectToRoute(RouteNames.Vacancy_Preview_Get));
        }
        public async Task WhenUpdated__ShouldCallUpdateDraftVacancy()
        {
            _fixture
            .WithThingsToConsider("has a value")
            .Setup();

            var thingsToConsiderEditModel = new ConsiderationsEditModel
            {
                EmployerAccountId = _fixture.Vacancy.EmployerAccountId,
                VacancyId         = _fixture.Vacancy.Id,
                ThingsToConsider  = "has a new value"
            };

            await _fixture.PostConsiderationsEditModelAsync(thingsToConsiderEditModel);

            _fixture.VerifyUpdateDraftVacancyAsyncIsCalled();
        }
        public async Task WhenThingsToConsiderIsUpdated_ShouldFlagThingsToConsiderFieldIndicator()
        {
            _fixture
            .WithThingsToConsider("has a value")
            .Setup();

            var thingsToConsiderEditModel = new ConsiderationsEditModel
            {
                EmployerAccountId = _fixture.Vacancy.EmployerAccountId,
                VacancyId         = _fixture.Vacancy.Id,
                ThingsToConsider  = "has a new value"
            };

            await _fixture.PostConsiderationsEditModelAsync(thingsToConsiderEditModel);

            _fixture.VerifyEmployerReviewFieldIndicators(FieldIdentifiers.ThingsToConsider, true);
        }
        public async Task <IActionResult> Considerations(ConsiderationsEditModel m)
        {
            var response = await _orchestrator.PostConsiderationsEditModelAsync(m, User.ToVacancyUser());

            if (!response.Success)
            {
                response.AddErrorsToModelState(ModelState);
            }

            if (!ModelState.IsValid)
            {
                var vm = await _orchestrator.GetConsiderationsViewModelAsync(m);

                return(View(vm));
            }

            return(RedirectToRoute(RouteNames.Vacancy_Preview_Get));
        }
 public async Task PostConsiderationsEditModelAsync(ConsiderationsEditModel model)
 {
     await Sut.PostConsiderationsEditModelAsync(model, User);
 }