Skip to content

Instantly share code, notes, and snippets.

@alieniasty
Last active January 31, 2018 13:51
Show Gist options
  • Save alieniasty/7d2a55cfb7d2b43b0a155c954a1a2ea9 to your computer and use it in GitHub Desktop.
Save alieniasty/7d2a55cfb7d2b43b0a155c954a1a2ea9 to your computer and use it in GitHub Desktop.
public class FakeHttpMessageHandler : HttpMessageHandler
{
public virtual HttpResponseMessage Send(HttpRequestMessage request)
{
throw new NotImplementedException("Implement this method through Moq Setup method inside your tests.");
}
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
{
return Task.FromResult(Send(request));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment