public async Task AddTrackToPlaylistFunc_Should_Return_Http_Not_found(string playlistId, string uris, string accessToken) { //Arrange var fakeResponseHandler = new FakeResponseHandler(); fakeResponseHandler.AddFakeResponse(new Uri("http://example.org/test"), new HttpResponseMessage(HttpStatusCode.OK)); var httpClient = new HttpClient(fakeResponseHandler); var qb = new QueryBuilder(); qb.Add("uris", uris); httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken); //Act var result = await httpClient.PostAsync(playlistAddTrackhBaseUrl.Replace("{playlist_id}", playlistId) + qb.ToQueryString(), null); //Assert Assert.That(result.StatusCode, Is.EqualTo(HttpStatusCode.NotFound)); }
public async Task CreatePlaylist_Should_Return_Http_Not_found(string playlistname, string accessToken) { //Arrange var fakeResponseHandler = new FakeResponseHandler(); fakeResponseHandler.AddFakeResponse(new Uri("http://example.org/test"), new HttpResponseMessage(HttpStatusCode.OK)); var httpClient = new HttpClient(fakeResponseHandler); var stringPayload = new { name = playlistname, description = playlistname }; var bodyPayload = new StringContent(JsonConvert.SerializeObject(stringPayload), Encoding.UTF8, "application/json"); httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken); //Act var result = await httpClient.PostAsync(playlistBaseUrl, bodyPayload); //Assert Assert.That(result.StatusCode, Is.EqualTo(HttpStatusCode.NotFound)); }