Migrate Static To Wrapper

ALWAYS USE when asked to migrate, replace, or make testable existing C# static calls with a named wrapper or built-in abstraction: DateTime.UtcNow/Now or DateTimeOffset.UtcNow to TimeProvider/IClock, File.* to IFileSystem or an existing store, and Environment.* to an existing reader. Covers scoped files/projects, constructor injection, updating tests with fakes, "already registered" abstractions, and static classes whose callers/signatures must stay unchanged. Preserves DateTimeKind and call count. DO NOT USE for finding statics (detect-static-dependencies), choosing/designing a new wrapper (generate-testability-wrappers), behavior tests with no chosen seam (testability-obstacle), or test-framework migration.

managedcode af28d13 2 files · 18.5 KB Updated

File contents

managedcode/dotnet-skills/tree/main/catalog/Testing/Official-DotNet-Test/skills/migrate-static-to-wrapper commit af28d13583

Frequently asked questions

npx skillmds@latest add managedcode/migrate-static-to-wrapper