示例#1
0
        public async Task ShouldThrowErrorWhenInValidInformation()
        {
            //Unregistered questionId
            var questionTypeDetailQuery = new GetQuestionTypeDetailQuery(78979);

            await Assert.ThrowsAsync <NotFoundException>(async() =>
                                                         await _getQuestionTypeDetailQueryHandler.Handle(questionTypeDetailQuery, CancellationToken.None));
        }
示例#2
0
        public async Task ShouldGetModelForValidInformation()
        {
            var questionTypeDetailQuery = new GetQuestionTypeDetailQuery(_questionTypeId);

            var questionTypeDetailResponseModel = await _getQuestionTypeDetailQueryHandler.Handle(questionTypeDetailQuery, CancellationToken.None);

            Assert.Null(questionTypeDetailResponseModel.Errors);
            Assert.Equal(expected: _context.QuestionTypes.First().Name, actual: questionTypeDetailResponseModel.Items.First().Name, ignoreCase: true);
        }