public DeleteAlbumAsync ( string albumId ) : Task |
||
albumId | string | The id or deletehash of the album. |
리턴 | Task |
public async Task DeleteAlbumAsync_True() { var mockResponse = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(MockAlbumEndpointResponses.Imgur.DeleteAlbum) }; var mockUrl = "https://api.imgur.com/3/album/12x5454"; var client = new ImgurClient("123", "1234"); var endpoint = new AlbumEndpoint(client, new HttpClient(new MockHttpMessageHandler(mockUrl, mockResponse))); var deleted = await endpoint.DeleteAlbumAsync("12x5454").ConfigureAwait(false); Assert.True(deleted); }
public async Task DeleteAlbumAsync_WithAlbumNull_ThrowsArgumentNullException() { var client = new ImgurClient("123", "1234"); var endpoint = new AlbumEndpoint(client); var exception = await Record.ExceptionAsync( async () => await endpoint.DeleteAlbumAsync(null).ConfigureAwait(false)) .ConfigureAwait(false); Assert.NotNull(exception); Assert.IsType<ArgumentNullException>(exception); }