public static FakeHttpMessageHandler GetHttpMessageHandler(string content, HttpStatusCode httpStatusCode)
        {
            var memStream = new MemoryStream();

            var sw = new StreamWriter(memStream);

            sw.Write(content);
            sw.Flush();
            memStream.Position = 0;

            var httpContent = new StreamContent(memStream);

            var responseMessage = new HttpResponseMessage
            {
                StatusCode = httpStatusCode,
                Content    = httpContent
            };

            var messageHandler = new FakeHttpMessageHandler(responseMessage);

            return(messageHandler);
        }
 public HttpClient CreateClient(string name)
 {
     Handler = FakeHttpMessageHandler.GetHttpMessageHandler(response, status);
     return(new HttpClient(Handler));
 }