Imgur.API.Tests.MockHttpMessageHandlerTests.HttpClient_GetAsync C# (CSharp) Method

HttpClient_GetAsync() private method

private HttpClient_GetAsync ( string requestUrl, string responseContent ) : System.Threading.Tasks.Task
requestUrl string
responseContent string
return System.Threading.Tasks.Task
        public async Task HttpClient_GetAsync(string requestUrl, string responseContent)
        {
            var mockResponse = new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent(responseContent)};

            var httpClient = new HttpClient(new MockHttpMessageHandler(requestUrl, mockResponse));
            var httpResponse = await httpClient.GetAsync(requestUrl).ConfigureAwait(false);
            var stringResponse = string.Empty;

            if (httpResponse.Content != null)
                stringResponse = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);

            Assert.Equal(responseContent, stringResponse);
        }