RemoveAlbumImagesAsync() 공개 메소드

Takes a list of imageIds and removes from the album. For anonymous albums, {albumId} should be the deletehash that is returned at creation.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public RemoveAlbumImagesAsync ( string albumId, IEnumerable imageIds ) : Task
albumId string The id or deletehash of the album.
imageIds IEnumerable The imageIds that you want to be removed from the album.
리턴 Task
예제 #1
0
        public async Task RemoveAlbumImagesAsync_WithIdNull_ThrowsArgumentNullException()
        {
            var client = new ImgurClient("123", "1234");
            var endpoint = new AlbumEndpoint(client);

            var exception =
                await
                    Record.ExceptionAsync(
                        async () => await endpoint.RemoveAlbumImagesAsync("12x5454", null).ConfigureAwait(false))
                        .ConfigureAwait(false);
            Assert.NotNull(exception);
            Assert.IsType<ArgumentNullException>(exception);
        }
예제 #2
0
        public async Task RemoveAlbumImagesAsync_True()
        {
            var mockUrl = "https://api.imgur.com/3/album/12x5454/remove_images?ids=AbcDef%2CIrcDef";
            var mockResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(MockAlbumEndpointResponses.Imgur.RemoveAlbumImages)
            };

            var client = new ImgurClient("123", "1234");
            var endpoint = new AlbumEndpoint(client, new HttpClient(new MockHttpMessageHandler(mockUrl, mockResponse)));
            var updated =
                await
                    endpoint.RemoveAlbumImagesAsync("12x5454", new List<string> {"AbcDef", "IrcDef"})
                        .ConfigureAwait(false);

            Assert.True(updated);
        }