public void AssertRequest(HttpMethod method, string path)
 {
     MockHandler.Protected()
     .Verify(
         "SendAsync",
         Times.Once(),
         ItExpr.Is <HttpRequestMessage>(m =>
                                        m.Method == method &&
                                        m.RequestUri.AbsolutePath == path),
         ItExpr.IsAny <CancellationToken>());
 }
        public void StubRequest(HttpMethod method, string path, HttpStatusCode status, string response)
        {
            var responseMessage = new HttpResponseMessage(status)
            {
                Content = new StringContent(response)
            };

            MockHandler.Protected()
            .Setup <Task <HttpResponseMessage> >(
                "SendAsync",
                ItExpr.Is <HttpRequestMessage>(m =>
                                               m.Method == method &&
                                               m.RequestUri.AbsolutePath == path),
                ItExpr.IsAny <CancellationToken>())
            .ReturnsAsync(responseMessage)
            .Verifiable();
        }