public UpdateAlbumAsync ( string albumId, string title = null, string description = null, AlbumPrivacy privacy = null, AlbumLayout layout = null, string coverId = null, IEnumerable |
||
albumId | string | The id or deletehash of the album. |
title | string | The title of the album. |
description | string | The description of the album. |
privacy | AlbumPrivacy | Sets the privacy level of the album. |
layout | AlbumLayout | Sets the layout to display the album. |
coverId | string | The Id of an image that you want to be the cover of the album. |
imageIds | IEnumerable |
The imageIds that you want to be included in the album. |
return | Task |
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); }