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
Recently, it's become a blocking error to set CallBase to true on Mocks of delegates.
This causes a regression is existing code that had set CallBase to true, and the MockDefaultValueProvider was being used to provide values for items that weren't setup.
Here's an illustration of the issue:
[Fact]publicvoidMockDefaultValueProvide_will_not_propagate_Callback_to_delegates(){varmock=newMock<IDictionary<string,Func<string>>>(){CallBase=true,DefaultValue= DefaultValue.Mock
};varmockedIndexResult= mock.Object["foo"];// This line throws because it attempts to set `CallBase` to true on the auto-generated mock for the delegate.
Assert.Null(mockedIndexResult());}
I can submit a PR to fix the bug-- it seems fairly straightforward.
The text was updated successfully, but these errors were encountered:
Recently, it's become a blocking error to set
CallBase
to true on Mocks of delegates.This causes a regression is existing code that had set
CallBase
to true, and theMockDefaultValueProvider
was being used to provide values for items that weren't setup.Here's an illustration of the issue:
I can submit a PR to fix the bug-- it seems fairly straightforward.
The text was updated successfully, but these errors were encountered: