Esempio n. 1
0
        // happy path
        public async Task WhenCalledOnValidRatedMovie_ReturnsState()
        {
            bool    isFavorite  = false;
            bool    onWatchlist = false;
            decimal rating      = 9m;

            await _client.RateMovie(_settings.SessionId, rating, _movie);

            // Server side (TMDB WebAPI) needs this delay to propagate changes...
            await Task.Delay(2000);

            GetAccountMovieStatesResult response = await _client.GetAccountMovieStates(_settings.SessionId, mediaId : _movie, guestSessionId : null, retryCount : 0);

            _output.WriteLine($"TMDB server's response code {response.HttpStatusCode}");
            _output.WriteLine($"TMDB server's response message {response.Json}");

            AccountMovieStates states = response.DeserializeJsonIntoModel();

            PrintAccountMovieStates(states);

            Assert.True(response.HttpStatusCode == System.Net.HttpStatusCode.OK);
            Assert.True(states.IsFavorite == isFavorite);
            Assert.True(states.Rating.Value == rating);
            Assert.True(states.OnWatchlist == onWatchlist);
        }
Esempio n. 2
0
        // happy path
        public async Task WhenCalledOnValidMovie_ReturnsState()
        {
            bool isFavorite  = false;
            bool onWatchlist = false;

            GetAccountMovieStatesResult response = await _client.GetAccountMovieStates(_settings.SessionId, mediaId : _movie, guestSessionId : null, retryCount : 0);

            _output.WriteLine($"TMDB server's response code {response.HttpStatusCode}");
            _output.WriteLine($"TMDB server's response message {response.Json}");

            AccountMovieStates states = response.DeserializeJsonIntoModel();

            PrintAccountMovieStates(states);

            Assert.True(response.HttpStatusCode == System.Net.HttpStatusCode.OK);
            Assert.True(states.IsFavorite == isFavorite);
            Assert.True(states.Rating == null);
            Assert.True(states.OnWatchlist == onWatchlist);
        }