Beispiel #1
0
        public static HttpClient PrepareHttpClient(string jsonResponse)
        {
            HttpResponseMessage httpResponseMessage = new HttpResponseMessage(HttpStatusCode.OK);
            httpResponseMessage.Content = new StringContent(jsonResponse);

            FakeResponseHandler responseHandler = new FakeResponseHandler();
            responseHandler.Response = httpResponseMessage;

            return new HttpClient(responseHandler);
        }