MockHttp
.NET library to mock HTTP responses for any HTTP client and verify request expectations with an experience inspired by Moq.
Install / Use
/learn @skwasjer/MockHttpREADME
MockHttp
Collection of .NET libraries to mock HTTP responses for any HTTP client (HttpClient, WebRequest, RestClient, etc.) and verify request expectations with an experience inspired by Moq.
| | | |
|---|---|---|
| skwas.MockHttp |
| Documentation |
|
skwas.MockHttp.Json |
| Documentation |
|
skwas.MockHttp.Server |
| Documentation |
Documentation
Please see the wiki for documentation.
Usage example
MockHttpHandler mockHttp = new MockHttpHandler();
// Configure setup(s).
mockHttp
.When(matching => matching
.Method("GET")
.RequestUri("http://localhost/controller/*")
)
.Respond(with => with
.StatusCode(200)
.JsonBody(new { id = 123, firstName = "John", lastName = "Doe" })
)
.Verifiable();
var client = new HttpClient(mockHttp);
var response = await client.GetAsync("http://localhost/controller/action?test=1");
// Verify expectations.
mockHttp.Verify();
Contributions
Please check out the contribution guidelines.
Related Skills
gh-issues
336.5kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
336.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Writing Hookify Rules
82.9kThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
