GetDefaultTopicsAsync() 공개 메소드

Get the list of default topics.
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 GetDefaultTopicsAsync ( ) : Task>
리턴 Task>
예제 #1
0
        public async Task GetDefaultTopicsAsync_True()
        {
            var mockUrl = "https://api.imgur.com/3/topics/defaults";
            var mockResponse = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(MockTopicEndpointResponses.GetDefaultTopics)
            };

            var client = new ImgurClient("123", "1234");
            var endpoint = new TopicEndpoint(client, new HttpClient(new MockHttpMessageHandler(mockUrl, mockResponse)));
            var topics = await endpoint.GetDefaultTopicsAsync().ConfigureAwait(false);
            var topic = topics.FirstOrDefault();

            Assert.NotNull(topic);
            Assert.NotNull(topic.TopPost);
            Assert.NotNull(topic.HeroImage);
        }