public async Task UpdateAlbumAsync_WithAlbum_AreEqual(IAlbum actualAlbum)
        {
            var client   = new MashapeClient(ClientId, ClientSecret, MashapeKey, OAuth2Token);
            var endpoint = new AlbumEndpoint(client);

            var updated = await endpoint.UpdateAlbumAsync(actualAlbum.Id, "TestTitle");

            Assert.IsTrue(updated);
        }
        public async Task UpdateAlbumAsync_WithAlbum_AreEqual(IAlbum actualAlbum)
        {
            var client   = new ImgurClient(ClientId, ClientSecret);
            var endpoint = new AlbumEndpoint(client);

            var updated = await endpoint.UpdateAlbumAsync(actualAlbum.DeleteHash, "TestTitle");

            Assert.IsTrue(updated);
        }
        public async Task UpdateAlbumAsync_WithIdNull_ThrowsArgumentNullException()
        {
            var client   = new ImgurClient("123", "1234");
            var endpoint = new AlbumEndpoint(client);

            var exception =
                await
                Record.ExceptionAsync(
                    async() => await endpoint.UpdateAlbumAsync(null).ConfigureAwait(false))
                .ConfigureAwait(false);

            Assert.NotNull(exception);
            Assert.IsType <ArgumentNullException>(exception);
        }
        public async Task UpdateAlbumAsync_True()
        {
            var mockUrl      = "https://api.imgur.com/3/album/12x5454";
            var mockResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(MockAlbumEndpointResponses.Imgur.UpdateAlbum)
            };

            var client   = new ImgurClient("123", "1234");
            var endpoint = new AlbumEndpoint(client, new HttpClient(new MockHttpMessageHandler(mockUrl, mockResponse)));
            var updated  = await endpoint.UpdateAlbumAsync("12x5454").ConfigureAwait(false);

            Assert.True(updated);
        }
        public async Task UpdateAlbumAsync_IsTrue()
        {
            var fakeHttpMessageHandler = new FakeHttpMessageHandler();
            var fakeResponse           = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(AlbumEndpointResponses.Imgur.UpdateAlbumResponse)
            };

            fakeHttpMessageHandler.AddFakeResponse(new Uri("https://api.imgur.com/3/album/12x5454"), fakeResponse);

            var client   = new ImgurClient("123", "1234");
            var endpoint = new AlbumEndpoint(client, new HttpClient(fakeHttpMessageHandler));
            var updated  = await endpoint.UpdateAlbumAsync("12x5454");

            Assert.IsTrue(updated);
        }
 public async Task UpdateAlbumAsync_WithIdNull_ThrowsArgumentNullException()
 {
     var client   = new ImgurClient("123", "1234");
     var endpoint = new AlbumEndpoint(client);
     await endpoint.UpdateAlbumAsync(null);
 }