mocking-inprocess-dotnet

Generate in-process test doubles for .NET downstream dependencies with WebApplicationFactory DI.

8|2|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/SebastienDegodez/skraft-plugin --skill mocking-inprocess-dotnet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mocking-inprocess-dotnet
Source: https://github.com/SebastienDegodez/skraft-plugin/tree/main/plugins/skills/mocking-inprocess-dotnet
Command: npx skills add https://github.com/SebastienDegodez/skraft-plugin --skill mocking-inprocess-dotnet

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires FakeItEasy, NSubstitute, Moq, and includes scripts (resource) components.

What problem does it solve?

This Skill provides an override for the mocking strategy in .NET applications, allowing for in-process test doubles to replace downstream dependencies instead of using a Microcks container.

Core Features & Use Cases

  • In-process Test Doubles: Replaces downstream dependencies with in-process test doubles (FakeItEasy, NSubstitute, or Moq).
  • WebApplicationFactory DI Integration: Registers the concrete double into the WebApplicationFactory DI.
  • Mock Wiring and Integration-Test Scaffold: Generates mock wiring and an integration-test scaffold without business TDD or provider contract verification.
  • Library Priority: Selects the mocking library based on priority and presence in the test project.
  • Use Case: When you need to mock a downstream dependency in a .NET application, this Skill can be used to generate the necessary code and configurations.

Quick Start

Use the mocking-inprocess-dotnet skill to create an in-process test double for the I{Downstream}Client interface in your test project.

Frequently Asked Questions about mocking-inprocess-dotnet

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

FAQPage Schema
How do I mock downstream dependencies in .NET integration tests?

In-process test doubles replace downstream dependencies in .NET by registering mocks directly into the WebApplicationFactory dependency injection container, eliminating the need for external container-based mocking setups.

Can I use FakeItEasy or NSubstitute with WebApplicationFactory DI?

Yes, in-process test doubles support FakeItEasy, NSubstitute, and Moq. The strategy selects the mocking library based on priority and presence in your test project, then registers the concrete double into the WebApplicationFactory DI container.

What is the best way to generate mock wiring for a .NET test project?

Generating mock wiring for a .NET test project is done by applying an in-process mocking strategy that creates test doubles for downstream interfaces. This automatically generates the mock wiring and an integration-test scaffold within the WebApplicationFactory DI setup.

Do I need a Microcks container for .NET in-process test doubles?

No, you do not need a Microcks container when using .NET in-process test doubles. This mocking strategy overrides container-based approaches by replacing downstream dependencies with in-process test doubles registered directly in the WebApplicationFactory DI.

Does in-process mocking generate provider contract verification scaffolds?

No, generating in-process test doubles does not include provider contract verification. The strategy generates mock wiring and an integration-test scaffold for downstream dependencies but omits business TDD and provider contract verification scaffolds.

When should I not use in-process test doubles for .NET?

You should avoid in-process test doubles when your .NET project requires provider contract verification or business TDD. This strategy generates mock wiring and integration-test scaffolds but does not verify external provider contracts.