public void SearchUsingImdbMovieUrlWithInvalidImdbMovieUrlThrowsArgumentException(string invalidImdbMovieUrl) { // Arrange var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret); // Act // Assert Assert.Throws<ArgumentException>(() => moviePosterDbService.Search(new Uri(invalidImdbMovieUrl))); }
public void SearchUsingImdbMovieIdAndImageWidthForMovieWithoutPosterReturnsNullForProperties() { // Arrange var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret); // Act var moviePosterDbResult = moviePosterDbService.Search(ImdbMovieIdWithoutPoster, ImageWidth); // Assert Assert.Null(moviePosterDbResult.Title); Assert.Null(moviePosterDbResult.Year); Assert.Null(moviePosterDbResult.ImdbMovieId); Assert.Null(moviePosterDbResult.Page); Assert.Null(moviePosterDbResult.Posters); }
public void SearchUsingImdbMovieIdAndImageWidthForMovieWithPosterWillReturnCorrectMoviePosterDbResult() { // Arrange var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret); // Act var moviePosterDbResult = moviePosterDbService.Search(ImdbMovieIdWithPoster, ImageWidth); // Assert Assert.Equal("Inception", moviePosterDbResult.Title); Assert.Equal("2010", moviePosterDbResult.Year); Assert.Equal("1375666", moviePosterDbResult.ImdbMovieId); Assert.Equal(@"http://api.movieposterdb.com/cache/normal/66/1375666/1375666_100.jpg", moviePosterDbResult.Posters[0].Url); Assert.Equal(1, moviePosterDbResult.Posters.Count()); }
public void SearchUsingImdbMovieUrlForMovieWithoutPosterReturnsNullForProperties(string imdbMovieUrl) { // Arrange var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret); // Act var moviePosterDbResult = moviePosterDbService.Search(new Uri(imdbMovieUrl)); // Assert Assert.Null(moviePosterDbResult.Title); Assert.Null(moviePosterDbResult.Year); Assert.Null(moviePosterDbResult.ImdbMovieId); Assert.Null(moviePosterDbResult.Page); Assert.Null(moviePosterDbResult.Posters); }
public void SearchUsingImdbMovieIdAndImageWidthWithImdbMovieIdOutOfRangeThrowsArgumentOutOfRangeException(int invalidImdbMovieId) { // Arrange var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret); // Act // Assert Assert.Throws<ArgumentOutOfRangeException>(() => moviePosterDbService.Search(invalidImdbMovieId, ImageWidth)); }