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
In 4.11.0 this test passes, that is it does NOT call into C1's implementation of "M"
However in 4.12.0 this test fails, result = "fromBase", it is as if the setup doesn't match. Uncommenting the .Returns line fixes it in 4.12.0. I think it has to do with the params object array
This took me a while to figure out, and I'm not entirely sure what the expected behavior should be, but I think this is a bug?
The text was updated successfully, but these errors were encountered:
Setups with no .Returns(…) nor .CallBase() no longer return default(T) for loose mocks, but a value that is consistent with the mock's CallBase and DefaultValue[Provider] settings. (@stakx, #849)
The change was made for improved consistency, and it's in line with a hint dropped by @kzu (can't find the reference right now) that setups on non-void methods without any Returns, Throws or CallBase are basically a user mistake and will be called out as such in Moq v5.
Consider the following code:
In 4.11.0 this test passes, that is it does NOT call into C1's implementation of "M"
However in 4.12.0 this test fails, result = "fromBase", it is as if the setup doesn't match. Uncommenting the .Returns line fixes it in 4.12.0. I think it has to do with the params object array
This took me a while to figure out, and I'm not entirely sure what the expected behavior should be, but I think this is a bug?
The text was updated successfully, but these errors were encountered: