Exemplo n.º 1
0
        public virtual ActionResult Index(Guid assessmentId)
        {
            var assessment = _assessmentHelper.GetAssessment(assessmentId);

            var questionAnswer = _questionAnswerHelper.GetQuestionAnswer(assessment);

            var viewModel = _questionViewModelBuilder.BuildQuestionViewModel(assessment, questionAnswer);

            return(View(viewModel));
        }
Exemplo n.º 2
0
        public void IndexGET_GivenAssessmentId_QuestionBuilderShouldBeCalled()
        {
            var assessmentId = Guid.NewGuid();
            var questionId   = Guid.NewGuid();

            var assessment = new Assessment()
            {
                CurrentWorkflowQuestionId = questionId
            };
            var questionAnswer = new QuestionAnswer();

            A.CallTo(() => _assessmentHelper.GetAssessment(assessmentId)).Returns(assessment);
            A.CallTo(() => _questionAnswerHelper.GetQuestionAnswer(assessment)).Returns(questionAnswer);

            _questionController.Index(assessmentId);

            A.CallTo(() => _questionViewModelBuilder.BuildQuestionViewModel(assessment, questionAnswer)).MustHaveHappened(Repeated.Exactly.Once);
        }