Exemplo n.º 1
0
        public async Task ShouldReturnTotalCountInSearchResults()
        {
            // Arrange
            _showStorageMock
            .Setup(x => x.GetShowsCount())
            .ReturnsAsync(123);

            // Act
            var searchResults = await _showProvider.GetShows(0, 1);

            // Assert
            Assert.That(searchResults.TotalCount, Is.EqualTo(123));
        }
        public async Task <ICollection <Show> > GetShows(int pageNum = 0, int pageSize = 10)
        {
            if (pageNum < 0)
            {
                throw new ArgumentException(nameof(pageNum));
            }

            if (pageSize < 0)
            {
                throw new ArgumentException(nameof(pageSize));
            }

            var searchResults = await _showProvider.GetShows(pageNum, pageSize);

            return(Mapper.Map <ICollection <Show> >(searchResults.Items));
        }