public async Task CreateAnswersAsync_UnauthorizedQuestionIdPassed_ReturnsUnauthorizedResult()
        {
            var user = new ClaimsPrincipal(new ClaimsIdentity(new Claim[]
            {
                new Claim(ClaimTypes.NameIdentifier, "1"),
            }));
            var exam = new Exam()
            {
                AuthorId = 2
            };

            var question = new Question()
            {
                Exam = exam
            };
            var mapperMock     = new Mock <IMapper>();
            var repositoryMock = new Mock <IRepositoryWrapper>();

            repositoryMock.Setup(r => r.QuestionRepository.GetQuestionAsync(It.IsAny <int>())).ReturnsAsync(question);
            repositoryMock.Setup(r => r.AnswerRepository.Add(It.IsAny <Answer>()));
            repositoryMock.Setup(r => r.SaveAllAsync()).ReturnsAsync(true);
            mapperMock.Setup(m => m.Map <IEnumerable <Answer> >(It.IsAny <IEnumerable <AnswerForCreationDto> >())).Returns(new List <Answer>());
            mapperMock.Setup(m => m.Map <IEnumerable <AnswerForReturnDto> >(It.IsAny <IEnumerable <Answer> >())).Returns(new List <AnswerForReturnDto>());

            var controllerMock = new AnswersController(repositoryMock.Object, mapperMock.Object);

            controllerMock.ControllerContext = new ControllerContext()
            {
                HttpContext = new DefaultHttpContext()
                {
                    User = user
                }
            };
            var result = await controllerMock.CreateAnswersAsync(1, new List <AnswerForCreationDto>());

            Assert.IsType <UnauthorizedResult>(result);
        }