public async Task GetAlbumImagesAsync_WithIdNull_ThrowsArgumentNullException() { var client = new ImgurClient("123", "1234"); var endpoint = new AlbumEndpoint(client); var exception = await Record.ExceptionAsync( async () => await endpoint.GetAlbumImagesAsync(null).ConfigureAwait(false)) .ConfigureAwait(false); Assert.NotNull(exception); Assert.IsType<ArgumentNullException>(exception); }
public async Task GetAlbumImagesAsync_ImageCountTrue() { var mockUrl = "https://api.imgur.com/3/album/5F5Cy/images"; var mockResponse = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(MockAlbumEndpointResponses.Imgur.GetAlbumImages) }; var client = new ImgurClient("123", "1234"); var endpoint = new AlbumEndpoint(client, new HttpClient(new MockHttpMessageHandler(mockUrl, mockResponse))); var images = await endpoint.GetAlbumImagesAsync("5F5Cy").ConfigureAwait(false); Assert.True(images.Count() == 3); }