Example #1
0
        public void EditPOST_GivenAssessmentViewModelAndModelStateIsValid_WorkflowHandlerShouldNotBeCalled()
        {
            var command = new UpdateAssessmentCommand();

            A.CallTo(() => _assessmentBuilder.BuildUpdateAssessmentCommand(A <AssessmentViewModel> ._)).Returns(command);

            _assessmentController.ModelState.AddModelError("error", "error");
            _assessmentController.Edit(A <AssessmentViewModel> ._, A <Guid> ._);

            A.CallTo(() => _workflowHandler.UpdateAssessmentWorkflowQuestion(command)).MustNotHaveHappened();
        }
Example #2
0
        public virtual ActionResult Edit(AssessmentViewModel model, Guid assessmentId)
        {
            if (ModelState.IsValid)
            {
                var command = _assessmentViewModelBuilder.BuildUpdateAssessmentCommand(model);

                _workflowHandler.UpdateAssessmentWorkflowQuestion(command);

                return(RedirectToAction(MVC.Question.Edit(model.AssessmentId)));
            }

            return(View(model));
        }