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
The test throws the "Wrong setup matched." exception.
Further information:
While the concrete generic arguments in the above test are irrelevant (since Moq matches generic arguments by assignment compatibility), the presence of generic type parameters are central to this issue as they disable any parameter type checks that would otherwise happen. Note the else in the following:
Code to reproduce:
Expected outcome:
The test should succeed.
Actual outcome:
The test throws the
"Wrong setup matched."
exception.Further information:
While the concrete generic arguments in the above test are irrelevant (since Moq matches generic arguments by assignment compatibility), the presence of generic type parameters are central to this issue as they disable any parameter type checks that would otherwise happen. Note the
else
in the following:https://github.com/moq/moq4/blob/3868424bac43b2c08342b363eb6c511fdbc982ea/src/Moq/InvocationShape.cs#L113-L126
As a side note, setup order also matters for this test.
The text was updated successfully, but these errors were encountered: