public void GetApiUrlUsingImdbMovieIdOutOfRangeThrowsArgumentOutOfRangeException(int invalidImdbMovieId) { // Arrange var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret); // Act // Assert Assert.Throws<ArgumentOutOfRangeException>(() => moviePosterDbService.GetApiUrl(invalidImdbMovieId, ImageWidth)); }
public void GetApiUrlUsingNullImdbMovieUrlThrowsArgumentNullException() { // Arrange Uri nullImdbMovieUrl = null; var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret); // Act // Assert Assert.Throws<ArgumentNullException>(() => moviePosterDbService.GetApiUrl(nullImdbMovieUrl, ImageWidth)); }
public void GetApiUrlUsingInvalidImdbMovieUrlThrowsArgumentException(string invalidImdbMovieUrl) { // Arrange var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret); // Act // Assert Assert.Throws<ArgumentException>(() => moviePosterDbService.GetApiUrl(new Uri(invalidImdbMovieUrl), ImageWidth)); }
public void GetApiUrlUsingImdbMovieUrlReturnsCorrectApiUrl(string imdbMovieUrl) { // Arrange var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret); // Act var apiUrl = moviePosterDbService.GetApiUrl(new Uri(imdbMovieUrl), ImageWidth); // Assert Assert.Equal("http://api.movieposterdb.com/json?imdb_code=2304771&api_key=test-api-key&secret=8435ce4c53ff&width=300", apiUrl.ToString()); }