MockHttp is a testing layer for Microsoft's HttpClient library. It allows stubbed responses to be configured for matched HTTP requests and can be used to test your application's service layer. MockHttp defines a replacement HttpMessageHandler, the engine that drives HttpClient, that provides a fluent configuration API and provides a canned response. The caller (eg. your application's service layer) remains unaware of its presence. MockHttpMessageHandler defines both When and Expect, which can be used to define responses. They both expose the same fluent API, but each works in a slightly different way. Using When specifies a "Backend Definition". Backend Definitions can be matched against multiple times and in any order, but they won't match if there are any outstanding Request Expectations present (unless BackendDefinitionBehavior.Always is specified).

Features

  • The Fallback property handles all requests that weren't handled by the match behavior
  • MockHttp is compiled for .NET Standard 2.0, .NET Standard 1.1, .NET 4, and .NET 4.5, as well a Portable Class Library (Profile 328)
  • License under the MIT license
  • MockHttpMessageHandler defines both When and Expect, which can be used to define responses
  • MockHttp defines a replacement HttpMessageHandler
  • MockHttp is a testing layer for Microsoft's HttpClient library

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

MIT License

Follow MockHttp for HttpClient

MockHttp for HttpClient Web Site

Other Useful Business Software
AestheticsPro Medical Spa Software Icon
AestheticsPro Medical Spa Software

Our new software release will dramatically improve your medspa business performance while enhancing the customer experience

AestheticsPro is the most complete Aesthetics Software on the market today. HIPAA Cloud Compliant with electronic charting, integrated POS, targeted marketing and results driven reporting; AestheticsPro delivers the tools you need to manage your medical spa business. It is our mission To Provide an All-in-One Cutting Edge Software to the Aesthetics Industry.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of MockHttp for HttpClient!

Additional Project Details

Operating Systems

Android, Apple iPhone, Windows

Programming Language

C#

Related Categories

C# Frameworks

Registered

2022-09-19