// happy path public async Task WhenValidMovieId_AddsMovie() { // Arrange int mediaId = _validMovieIds.First(); // Act var result = await _client.AddMovie(_settings.SessionId, _listId, mediaId); _output.WriteLine($"{nameof(_client.AddMovie)}(list: {_listId}, mediaId: {mediaId}) responded with: {result.HttpStatusCode}"); if (result.HttpStatusCode.IsSuccessCode()) { _output.WriteLine($"TMDB server's response message {result.Json}"); } // Assert Assert.True(result.HttpStatusCode == System.Net.HttpStatusCode.Created); }
// Setup: create a temporary list with movies for the tests public async Task InitializeAsync() { var createListResult = await _client.CreateList(sessionId : _settings.SessionId, name : "Test list1 with movies", description : ""); _output.WriteLine($"{nameof(InitializeAsync)}: {nameof(_client.CreateList)}() returned {createListResult.HttpStatusCode}"); _listId = JsonConvert.DeserializeObject <ListCrudResponseModel>(createListResult.Json).ListId; _output.WriteLine($"{nameof(InitializeAsync)}: list created with id {_listId}"); foreach (var mediaId in _validMovieIds) { var result = await _client.AddMovie(_settings.SessionId, _listId, mediaId); _output.WriteLine($"{nameof(InitializeAsync)}: {nameof(_client.AddMovie)}(list: {_listId}, mediaId: {mediaId}) responded with: {result.HttpStatusCode}"); } }