public async Task GetAllArticleAsync__An_unexpected_internal_error_occurred__Should_throw_Exception()
        {
            _articleDbServiceMock.Setup(x => x.GetAllAsync()).ThrowsAsync(new Exception());
            var controller = new ArticlesController(_articleDbServiceMock.Object, _logger, _mapperMock.Object);

            Func <Task> result = async() => await controller.GetAllArticlesAsync();

            await result.Should().ThrowExactlyAsync <Exception>();
        }
        public async Task GetAllArticleAsync__At_least_one_element_found__Should_return_200OK_response_with_not_empty_IEnumerable()
        {
            _articleDbServiceMock.Setup(x => x.GetAllAsync()).ReturnsAsync(_articles);
            _mapperMock.Setup(x => x.Map <IEnumerable <ArticleDto> >(It.IsNotNull <IEnumerable <Article> >())).Returns(_articleDtos.AsEnumerable());
            var controller = new ArticlesController(_articleDbServiceMock.Object, _logger, _mapperMock.Object);

            var result = await controller.GetAllArticlesAsync();

            (result as ObjectResult).StatusCode.Should().Be(200);
            (((result as ObjectResult).Value as ResponseWrapper).Data as IEnumerable <ArticleDto>).Should().NotBeEmpty();
        }
        public async Task GetAllArticleAsync__An_internal_error_reffered_to_the_database_occurred__Should_throw_InternalDbServiceException()
        {
            // Example of these errors: database does not exist, table does not exist etc.

            _articleDbServiceMock.Setup(x => x.GetAllAsync()).ThrowsAsync(new InternalDbServiceException());
            var controller = new ArticlesController(_articleDbServiceMock.Object, _logger, _mapperMock.Object);

            Func <Task> result = async() => await controller.GetAllArticlesAsync();

            await result.Should().ThrowExactlyAsync <InternalDbServiceException>();
        }