public AddAlbumImagesAsync ( string albumId, IEnumerable |
||
albumId | string | The id or deletehash of the album. |
imageIds | IEnumerable |
The imageIds that you want to be added to the album. |
Résultat | Task |
public async Task AddAlbumImagesAsync_WithIdNull_ThrowsArgumentNullException() { var client = new ImgurClient("123", "1234"); var endpoint = new AlbumEndpoint(client); var exception = await Record.ExceptionAsync( async () => await endpoint.AddAlbumImagesAsync("12x5454", null).ConfigureAwait(false)) .ConfigureAwait(false); Assert.NotNull(exception); Assert.IsType<ArgumentNullException>(exception); }
public async Task AddAlbumImagesAsync_True() { var mockResponse = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(MockAlbumEndpointResponses.Imgur.AddAlbumImages) }; var mockUrl = "https://api.imgur.com/3/album/12x5454/add"; var client = new ImgurClient("123", "1234"); var endpoint = new AlbumEndpoint(client, new HttpClient(new MockHttpMessageHandler(mockUrl, mockResponse))); var updated = await endpoint.AddAlbumImagesAsync("12x5454", new List<string> {"AbcDef", "IrcDef"}).ConfigureAwait(false); Assert.True(updated); }