コード例 #1
0
        public void CalculateSecretUsingImdbMovieIdOutOfRangeThrowsArgumentOutOfRangeException(int invalidImdbMovieId)
        {
            // Arrange
            var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret);

            // Act

            // Assert
            Assert.Throws<ArgumentOutOfRangeException>(() => moviePosterDbService.CalculateSecret(invalidImdbMovieId));
        }
コード例 #2
0
        public void CalculateSecretUsingNullImdbMovieUrlThrowsArgumentNullException()
        {
            // Arrange
            Uri nullImdbMovieUrl = null;
            var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret);

            // Act

            // Assert
            Assert.Throws<ArgumentNullException>(() => moviePosterDbService.CalculateSecret(nullImdbMovieUrl));
        }
コード例 #3
0
        public void CalculateSecretUsingInvalidImdbUrlThrowsArgumentException(string invalidImdbMovieUrl)
        {
            // Arrange
            var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret);

            // Act

            // Assert
            Assert.Throws<ArgumentException>(() => moviePosterDbService.CalculateSecret(new Uri(invalidImdbMovieUrl)));
        }
コード例 #4
0
        public void CalculateSecretUsingImdbMovieUrlReturnsCorrectSecret(string imdbMovieUrl)
        {
            // Arrange
            var moviePosterDbService = new MoviePosterDbService(ApiKey, ApiSecret);

            // Act
            var calculateSecret = moviePosterDbService.CalculateSecret(new Uri(imdbMovieUrl));

            // Assert
            Assert.Equal("8435ce4c53ff", calculateSecret);
        }