public void Arrange() { _validator = new MakeAppealViewModelValidator(); _viewModel = new MakeAppealViewModel { ApplicationId = Guid.NewGuid() }; }
public async Task MakeAppeal_shows_make_appeal_page_if_within_appeal_window() { var model = new MakeAppealViewModel { ApplicationId = _applicationId }; var result = await _controller.MakeAppeal(_applicationId); var viewResult = result as ViewResult; viewResult.Should().NotBeNull(); viewResult.ViewName.Should().Contain("MakeAppeal.cshtml"); viewResult.Model.Should().BeEquivalentTo(model); }
public async Task <IActionResult> MakeAppeal(MakeAppealViewModel model) { if (!await CanMakeAppeal(model.ApplicationId)) { return(RedirectToAction("ProcessApplicationStatus", "RoatpOverallOutcome", new { model.ApplicationId })); } if (!ModelState.IsValid) { return(View("~/Views/Appeals/MakeAppeal.cshtml", model)); } return(RedirectToAction("GroundsOfAppeal", new { model.ApplicationId, model.AppealOnPolicyOrProcesses, model.AppealOnEvidenceSubmitted })); }
public async Task <IActionResult> MakeAppeal(Guid applicationId) { if (!await CanMakeAppeal(applicationId)) { return(RedirectToAction("ProcessApplicationStatus", "RoatpOverallOutcome", new { applicationId })); } var model = new MakeAppealViewModel { ApplicationId = applicationId }; return(View("~/Views/Appeals/MakeAppeal.cshtml", model)); }
public async Task POST_MakeAppeal_shows_GroundsOfAppeal_page_when_valid_input_submitted() { var model = new MakeAppealViewModel { ApplicationId = _applicationId, AppealOnEvidenceSubmitted = true, AppealOnPolicyOrProcesses = true }; var result = await _controller.MakeAppeal(model); var viewResult = result as RedirectToActionResult; viewResult.Should().NotBeNull(); viewResult.ActionName.Should().Be("GroundsOfAppeal"); }