Repository navigation
0.3.0
Change Log
0.3.0 (04/22/2026)
Full Changelog
Merged Pull Requests
Reset mock when MockService is called again for the same type (04/22/2026) #10 (seesharper)
Summary
RegisterMockAsSingleton<T>now tracks registered mocks perTestApplicationinstance using aConditionalWeakTable<IHostBuilderConfiguration, Dictionary<Type, object>>- A second call to
MockService<T>(or any of its typed wrappers) for an already-registered type returns the sameMock<T>instance withReset()called, rather than creating and registering a new one - This works after
CreateClient()has been called since the mock object already registered as a singleton in DI is reset in place
Test plan
-
ShouldResetMockWhenCalledTwiceOnSameTestApplicationverifies the returned mock is the same instance, invocations are cleared after reset, and only the new round's calls are recorded - All 18 existing tests continue to pass
🤖 Generated with Claude Code