Skip to content

Allow GetMock<IServiceProvider>() to return a mock instead of the AutoMocker instance#451

Merged
Keboo merged 1 commit intomasterfrom
fix450
Mar 16, 2026
Merged

Allow GetMock<IServiceProvider>() to return a mock instead of the AutoMocker instance#451
Keboo merged 1 commit intomasterfrom
fix450

Conversation

@Keboo
Copy link
Collaborator

@Keboo Keboo commented Mar 16, 2026

Fixes #450. This change ensures that the SelfResolver is bypassed when a mock is explicitly requested via GetMock, allowing a mock of IServiceProvider (or other self-resolved types) to be created rather than returning the AutoMocker instance itself.

…oMocker instance

Fixes #450. This change ensures that the SelfResolver is bypassed when a mock is explicitly requested via GetMock, allowing a mock of IServiceProvider (or other self-resolved types) to be created rather than returning the AutoMocker instance itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Functional regression in Moq.AutoMock 4.0.0

1 participant