SearchGalleryAdvancedAsync() 공개 메소드

Search the gallery with a given query string.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public SearchGalleryAdvancedAsync ( string qAll = null, string qAny = null, string qExactly = null, string qNot = null, ImageFileType fileType = null, ImageSize imageSize = null, GallerySortOrder sort = GallerySortOrder.Time, TimeWindow window = TimeWindow.All, int page = null ) : Task>
qAll string Search for all of these words (and).
qAny string Search for any of these words (or).
qExactly string Search for exactly this word or phrase.
qNot string Exclude results matching this word or phrase.
fileType ImageFileType Show results for a specific file type.
imageSize ImageSize Show results for a specific image size.
sort GallerySortOrder The order that the gallery should be sorted by. Default: Time
window TimeWindow The time period that should be used in filtering requests. Default: Day
page int The data paging number. Default: null
리턴 Task>
        public async Task SearchGalleryAdvancedAsync_WithQueriesNull_ThrowsArgumentNullException()
        {
            var client = new ImgurClient("123", "1234");
            var endpoint = new GalleryEndpoint(client);

            var exception =
                await
                    Record.ExceptionAsync(
                        async () => await endpoint.SearchGalleryAdvancedAsync().ConfigureAwait(false))
                        .ConfigureAwait(false);
            Assert.NotNull(exception);
            Assert.IsType<ArgumentNullException>(exception);
        }
        public async Task SearchGalleryAdvancedAsync_True()
        {
            var mockUrl =
                "https://api.imgur.com/3/gallery/search/top/week/2?q_all=star+wars&q_any=luke+han+leia&q_exactly=Obi-Wan&q_not=Kirk&q_type=anigif&q_size_px=lrg";
            var mockResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(MockGalleryEndpointResponses.SearchGalleryAdvanced)
            };

            var client = new ImgurClient("123", "1234");
            var endpoint = new GalleryEndpoint(client,
                new HttpClient(new MockHttpMessageHandler(mockUrl, mockResponse)));
            var galleries =
                await
                    endpoint.SearchGalleryAdvancedAsync("star wars", "luke han leia", "Obi-Wan", "Kirk",
                        ImageFileType.Anigif, ImageSize.Lrg, GallerySortOrder.Top, TimeWindow.Week, 2)
                        .ConfigureAwait(false);

            Assert.True(galleries.Any());
        }