Пример #1
0
        public async Task <List <ShortMovieDto> > GetMoviesByTitle(string title, int page = 1)
        {
            var searchResultsModel = await _thirdPartyMovieRepository.GetMoviesByTitle(title, page);

            var shortMovieDtos = _mapper.Map <List <ShortMovieModel>, List <ShortMovieDto> >(searchResultsModel.Movies);

            return(shortMovieDtos);
        }
Пример #2
0
        public async Task GetMoviesByTitle(string title, int ExpectedTotalResults, int page)
        {
            //Arrange
            int expectedTotalPageCount = 10;
            //Act
            var result = await _movieRepository.GetMoviesByTitle(title, page);

            //Assert
            result.TotalResults.Should().Be(ExpectedTotalResults);
            result.Movies.Should().HaveCount(expectedTotalPageCount);
            result.Movies.TrueForAll(m => m.Title.Contains(title));
        }