Esempio n. 1
0
 public CreateRequestTokenTests()
 {
     _settingsKeyValues = new Dictionary <string, object>();
     _settingsKeyValues[nameof(Settings.ApiKey)] = "764d596e888359d26c0dc49deffecbb3";
     _settings = new Settings(_settingsKeyValues, null);
     _client   = new TmdbNetworkClient(null, _settings.ApiKey);
     Trace.WriteLine(nameof(CreateRequestTokenTests) + " constructor passed");
 }
 public GetListDetailsTests(ITestOutputHelper output)
 {
     _output            = output;
     _settingsKeyValues = new Dictionary <string, object>();
     _settingsKeyValues[nameof(Settings.ApiKey)]    = "764d596e888359d26c0dc49deffecbb3";
     _settingsKeyValues[nameof(Settings.SessionId)] = "563636d0e4a0b41b775ba7703cc5c985f36cffaf"; // !!!! correct it !!!!!
     _settings = new Settings(_settingsKeyValues, null);
     _client   = new TmdbNetworkClient(null, _settings.ApiKey);
 }
        public GetTrendingMoviesTests(ITestOutputHelper output)
        {
            _output = output;

            _settingsKeyValues = new Dictionary <string, object>();
            _settingsKeyValues[nameof(Settings.ApiKey)] = "764d596e888359d26c0dc49deffecbb3";
            _settings = new Settings(_settingsKeyValues, null);
            _client   = new TmdbNetworkClient(null, _settings.ApiKey);
        }
Esempio n. 4
0
 public CreateListTests(ITestOutputHelper output)
 {
     _output            = output;
     _listIdsToDispose  = new List <int>();
     _settingsKeyValues = new Dictionary <string, object>();
     _settingsKeyValues[nameof(Settings.ApiKey)]    = "764d596e888359d26c0dc49deffecbb3";
     _settingsKeyValues[nameof(Settings.SessionId)] = "17e9c7d453286dbd089842c056f5316605516f26";
     _settings = new Settings(_settingsKeyValues, null);
     _client   = new TmdbNetworkClient(null, _settings.ApiKey);
 }
Esempio n. 5
0
        public GetMovieDetailsWithAccountStatesTests_AccountMovieStates_ONLY(ITestOutputHelper output)
        {
            _output = output;

            _settingsKeyValues = new Dictionary <string, object>();
            _settingsKeyValues[nameof(Settings.ApiKey)]    = "764d596e888359d26c0dc49deffecbb3";
            _settingsKeyValues[nameof(Settings.SessionId)] = "563636d0e4a0b41b775ba7703cc5c985f36cffaf";
            _settings = new Settings(_settingsKeyValues, null);
            _client   = new TmdbNetworkClient(null, _settings.ApiKey);
        }
        // Setup steps:
        // -(1) set up a new unused request token
        // -(2) Validate the request token
        // -(3) Create a new session

        public DeleteSessionTests(ITestOutputHelper output)
        {
            _output = output;

            _settingsKeyValues = new Dictionary <string, object>();
            _settingsKeyValues[nameof(Settings.ApiKey)]      = "764d596e888359d26c0dc49deffecbb3";
            _settingsKeyValues[nameof(Settings.AccountName)] = "j4nitest";
            _settingsKeyValues[nameof(Settings.Password)]    = "awx123.";
            _settings = new Settings(_settingsKeyValues, null);
            _client   = new TmdbNetworkClient(null, _settings.ApiKey);
        }
Esempio n. 7
0
        public async Task WhenApiKeyIsInvalidAndCalledMultipleTimes_DoesNotBreakAndGivesErrorCode()
        {
            //Arrange
            var client = new TmdbNetworkClient(null, "invalidkeytest1012");

            //Act
            CreateRequestTokenResult result = await client.CreateRequestToken(3, 1000);

            //Assert
            Assert.True(result.HttpStatusCode == System.Net.HttpStatusCode.Unauthorized);
        }
        public RemoveMovieTests(ITestOutputHelper output)
        {
            _output = output;

            _settingsKeyValues = new Dictionary <string, object>();
            _settingsKeyValues[nameof(Settings.ApiKey)]    = "764d596e888359d26c0dc49deffecbb3";
            _settingsKeyValues[nameof(Settings.SessionId)] = "17e9c7d453286dbd089842c056f5316605516f26";
            _settings = new Settings(_settingsKeyValues, null);
            _client   = new TmdbNetworkClient(null, _settings.ApiKey);

            _validMovieIds = new List <int>
            {
                23047, // Season of the Witch
                1542   // Office Space
            };
        }
        // error path
        public async Task WhenCalledWithInValidApiKeyAndRetryOption_ReturnsCode401AndDoesNotBreak(int retryCount, int delayMilliseconds)
        {
            // Arrange
            var client = new TmdbNetworkClient(null, "invalidkeytestcase");

            // Act
            var result = await client.ValidateRequestTokenWithLogin(
                _settings.AccountName,
                _settings.Password,
                RequestToken,
                retryCount,
                delayMilliseconds
                );

            // Assert
            Assert.True(result.HttpStatusCode == System.Net.HttpStatusCode.Unauthorized);
        }