mockly

Mock HTTP interactions for .NET tests with configurable URL, header, and body matching.

39|9|Updated Oct 6, 2025
One-click install
npx skills add https://github.com/dennisdoomen/mockly --skill mockly
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mockly
Source: https://github.com/dennisdoomen/mockly/tree/main
Command: npx skills add https://github.com/dennisdoomen/mockly --skill mockly

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Mockly provides a fluent, configurable HTTP mocking layer for .NET tests, enabling deterministic responses and rich verification of HttpClient interactions.

Core Features & Use Cases

  • Fluent request matching via path, query, headers and body
  • JSON/ODATA responses, Problem Details, and raw content support
  • Request capture, invocation limits, and FluentAssertions-integrated assertions

Quick Start

Create an HttpMock, define a simple GET mock for a path, obtain a client via GetClient, and issue a request to verify the mock.

Frequently Asked Questions about mockly

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I mock HttpClient interactions in .NET unit tests?

Mock HttpClient interactions for .NET tests by creating an HttpMock, defining verb-specific builders like ForGet or ForPost, and using GetClient to issue requests. This provides a configurable HTTP mock layer for deterministic responses.

Can I match HTTP requests by JSON body and query parameters when mocking?

HTTP request matching supports query parameters, headers, and body matching, including JSON equivalence, regex, and form fields. URL and host matching also support wildcards for flexible request verification in tests.

What's the best way to verify HttpClient calls in .NET testing?

Verify HttpClient calls by capturing requests and applying invocation limits like Once or Times. FluentAssertions integration enables rich assertions directly against the captured mock interactions for deterministic test validation.

Does this HTTP mocking tool support returning JSON and binary responses?

HTTP mocking supports returning JSON, ODATA, Problem Details, and raw binary content. Responses are configurable per mock, enabling deterministic outputs for diverse HttpClient-based integration and unit test scenarios.

Can I limit a mocked HTTP endpoint to a specific number of calls?

Limit mocked HTTP endpoint calls using per-mock invocation limits such as Once or Times. This ensures your unit tests enforce strict expectations on how many times an HttpClient request is issued.