Пример #1
0
        public async Task GetMovieByTitle(string title, string id)
        {
            //Act
            var movie = await _movieRepository.GetMovieByTitle(title);

            //Assert
            movie.Id.Should().Be(id);
        }
Пример #2
0
        public async Task <Movie> GetMovieByTitle(string title)
        {
            var movieModel = await _movieRespository.GetMovieWithGenre(x => x.Title.ToLower() == title.ToLower());

            if (movieModel != null)
            {
                movieModel.Poster = await DownloadMoviePoster(movieModel);

                return(movieModel);
            }

            movieModel = await _thirdPartyMovieRepository.GetMovieByTitle(title);

            if (movieModel != null)
            {
                movieModel.Poster = await DownloadMoviePoster(movieModel);
            }

            await AddMovie(movieModel);

            return(movieModel);
        }