Lightlines
Catalogue
Sign in
By dotnet

generate-testability-wrappers

dotnet

Static dependencies, ready for deterministic tests.

C# testability

What it does

Generates wrapper interfaces, default implementations, and DI service registration code for untestable static dependencies.

When to use it

Use it after identifying statics to wrap, when replacing statics with injected abstractions, or when adopting the listed abstractions.

How to use it

Give it a project, static category, and target framework; it generates or guides the required abstraction, composition, and deterministic test artifacts in the project.

What you provide

  • static category
  • target framework
  • An existing project

Access · 2

This skill

System.IO.Abstractions

Execute

Installs System.IO.Abstractions

System.IO.Abstractions.TestingHelpers

Execute

Installs filesystem testing helpers

What you need · 4

The package is required when adopting TimeProvider on .NET versions before .NET 8.

The testing package is required for the FakeTimeProvider test path.

The package is required for the established filesystem-wrapper adoption path.

The package is required to test filesystem consumers with MockFileSystem.


About this skill

Visibility
Public
Repository
dotnet/skills
Created
Oct 8, 2026
Updated
Oct 8, 2026
Files
1