public override void Given()
 {
     ViewModel = new RequestSoaCancelViewModel {
         ProfileId = 1, CancelRequest = null
     };
     Controller.ModelState.AddModelError("CancelRequest", Content.StatementOfAchievement.RequestSoaCancel.Validation_Message);
 }
        public IActionResult RequestSoaCancel(RequestSoaCancelViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(viewModel));
            }

            return(viewModel.CancelRequest.Value
                ? RedirectToRoute(RouteConstants.Home)
                : RedirectToRoute(RouteConstants.RequestSoaCheckAndSubmit, new { profileId = viewModel.ProfileId }));
        }
        public async Task <IActionResult> RequestSoaCancelAsync(int profileId)
        {
            var learnerDetails = await _statementOfAchievementLoader.GetSoaLearnerRecordDetailsAsync(User.GetUkPrn(), profileId);

            if (learnerDetails == null || !learnerDetails.IsValid)
            {
                return(RedirectToRoute(RouteConstants.PageNotFound));
            }

            var viewModel = new RequestSoaCancelViewModel {
                ProfileId = learnerDetails.ProfileId, LearnerName = learnerDetails.LearnerName
            };

            return(View(viewModel));
        }
 public override void Given()
 {
     ViewModel = new RequestSoaCancelViewModel {
         ProfileId = 1, CancelRequest = true
     };
 }