dotnet-testing-autofixture-nsubstitute-integration

Community

Auto-mock tests with AutoFixture + NSubstitute.

Authorkevintsengtw
Version1.0.0
Installs0

System Documentation

What problem does it solve?

When writing unit tests in .NET, developers often hand-roll mocks for multiple dependencies, which creates boilerplate and brittle tests. This Skill automates substitution using AutoFixture.AutoNSubstitute, enabling automatic mock creation for interfaces and abstract types so tests remain focused on behavior.

Core Features & Use Cases

  • Auto-mocking of interfaces and abstract classes via AutoFixture.AutoNSubstitute.
  • Simplified test setup for services with multiple dependencies using [Frozen], [AutoData], and custom AutoData attributes.
  • Seamless integration with xUnit and NuGet-based setup for rapid test scaffolding.

Quick Start

Install required NuGet packages:

  • AutoFixture.AutoNSubstitute
  • AutoFixture
  • AutoFixture.Xunit2 Then write tests using [Theory] and [AutoDataWithCustomization] or [AutoNSubstituteData], and freeze dependencies to share instances across the system under test.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: dotnet-testing-autofixture-nsubstitute-integration
Download link: https://github.com/kevintsengtw/dotnet-testing-agent-skills/archive/main.zip#dotnet-testing-autofixture-nsubstitute-integration

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.