Exemple #1
0
        public async Task GetUserAnswersAsync_ValidExamAndUserIdPassed_ReturnsOkObjectResult()
        {
            var mapperMock     = new Mock <IMapper>();
            var repositoryMock = new Mock <IRepositoryWrapper>();

            repositoryMock.Setup(r => r.UserAnswerRepository.GetUserAnswersAsync(It.IsAny <int>(), It.IsAny <int>())).ReturnsAsync(new List <UserAnswer>());
            var controllerMock = new ExamsController(repositoryMock.Object, mapperMock.Object);
            var result         = await controllerMock.GetUserAnswersAsync(1, 1);

            Assert.IsType <OkObjectResult>(result);
        }