Quality Assurance & Testing
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 such as ITextFileStore, and Environment.* to an existing reader such as IEnvironmentReader. Covers scoped files/projects, constructor injection, replacing temp-file or process-environment 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.
- Publisher / source
- dotnet/skills (found on skills.sh)
- Upstream record
- dotnet/skills
- Version
- Version 1
- Published
- Publication review
- Approved for publication · recorded passed scan 2026-11-01
- Content fingerprint
0f4dcf5f3808d0ed089f57916d64945a59769f55c65b6b30db7f17e119a974f7