public IActionResult ReviewSectorAnswers(SubmitOutcomePageAnswerCommand command) { return(RedirectToAction("ReviewPageAnswers", "OutcomeSectionReview", new { applicationId = command.ApplicationId, sequenceNumber = SequenceIds.DeliveringApprenticeshipTraining, sectionNumber = SectionIds.DeliveringApprenticeshipTraining.YourSectorsAndEmployees })); }
public IActionResult ReviewPageAnswers(SubmitOutcomePageAnswerCommand command) { if (string.IsNullOrEmpty(command.NextPageId)) { return(RedirectToAction("ViewApplication", "OutcomeOverview", new { applicationId = command.ApplicationId }, $"sequence-{command.SequenceNumber}")); } else { return(RedirectToAction("ReviewPageAnswers", "OutcomeSectionReview", new { applicationId = command.ApplicationId, sequenceNumber = command.SequenceNumber, sectionNumber = command.SectionNumber, pageId = command.NextPageId })); } }
public void POST_ReviewPageAnswers_when_has_NextPage_Redirects_To_Next_Page() { var viewModel = new OutcomeReviewAnswersViewModel { ApplicationId = _applicationId, SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, PageId = _pageId, NextPageId = _nextPageId }; var command = new SubmitOutcomePageAnswerCommand(viewModel); _sectionReviewOrchestrator.Setup(x => x.GetReviewAnswersViewModel(It.IsAny <GetReviewAnswersRequest>())).ReturnsAsync(viewModel); // act var result = _controller.ReviewPageAnswers(command) as RedirectToActionResult; // assert Assert.AreEqual("OutcomeSectionReview", result.ControllerName); Assert.AreEqual("ReviewPageAnswers", result.ActionName); }