You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ConcreteDependency and SystemUnderTest receive different instances of IService and the one passed to ConcreteDependency is kept around as the resolved instance.
Expected
Both classes should receive the same mock.
"Workarounds"
Move the ConcreteDependency parameter to before the interface.
Resolve/cache the mock before calling CreateInstance. i.e. _ = mocker.GetMock<IService>();
The text was updated successfully, but these errors were encountered:
I haven't validated this minimum-reproducible sample, but ran into this on a project:
Actual
ConcreteDependency
andSystemUnderTest
receive different instances ofIService
and the one passed toConcreteDependency
is kept around as the resolved instance.Expected
Both classes should receive the same mock.
"Workarounds"
ConcreteDependency
parameter to before the interface.CreateInstance
. i.e._ = mocker.GetMock<IService>();
The text was updated successfully, but these errors were encountered: