public async Task GetCustomGalleryAsync_WithOAuth2TokenNull_ThrowsArgumentNullException()
{
var mockUrl = "https://api.imgur.com/3/g/custom/top/month/1";
var mockResponse = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent(MockCustomGalleryEndpointResponses.GetCustomGallery)
};
var client = new ImgurClient("123", "1234");
var endpoint = new CustomGalleryEndpoint(client,
new HttpClient(new MockHttpMessageHandler(mockUrl, mockResponse)));
var exception =
await
Record.ExceptionAsync(
async () =>
await
endpoint.GetCustomGalleryAsync(CustomGallerySortOrder.Top, TimeWindow.Month, 1)
.ConfigureAwait(false))
.ConfigureAwait(false);
Assert.NotNull(exception);
Assert.IsType<ArgumentNullException>(exception);
}