title: Mocking HttpResponse WriteAsync
body: <p>I'm trying to get a call to <code>WriteAsync</code> mocked on a mock<code>HttpResponse</code> and I can't figure out the syntax to use.</p>
  
  <pre><code>var responseMock = new Mock&lt;HttpResponse&gt;();
  responseMock.Setup(x =&gt; x.WriteAsync(It.IsAny&lt;string&gt;(), It.IsAny&lt;CancellationToken&gt;()));
  
  ctx.Setup(x =&gt; x.Response).Returns(responseMock.Object);
  </code></pre>
  
  <p>The test bombs with the following error:</p>
  
  <blockquote>
    <p>System.NotSupportedException : Invalid setup on an extension method: x
    => x.WriteAsync(It.IsAny(), It.IsAny())</p>
  </blockquote>
  
  <p>Ultimately I want to verify the correct string has been written to the response.</p>
  
  <p>How to correctly set this up?</p>