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
I have two identical unit tests. The difference is the version of Moq. UnitTestProject1 uses Moq 4.14.5 and fails to load IOptions into the properties. UnitTestProject2 uses Moq 4.13.1 and passes
UPDATE: can confirm this is also broken in 4.14.0. so it might have been somewhere within that minor version change
The text was updated successfully, but these errors were encountered:
Thanks for reporting @mariotee, looks like a regression. I never stop being surprised by the simple use cases that our unit/regression test suite doesn't cover... we're still lacking some rather basic tests it seems.
Note to self, here's the repro in abbreviated form:
This is not specific to IOptions. It looks like using Mock.Of with any sub-properties results in System.Reflection.TargetException : Object does not match target type.
Example: var orderItem = Mock.Of<OrderItem>(x => x.Order.Id == 123);
repro repo: https://github.com/mariotee/Moq-MockOf-Issue
I have two identical unit tests. The difference is the version of Moq.
UnitTestProject1
uses Moq 4.14.5 and fails to load IOptions into the properties.UnitTestProject2
uses Moq 4.13.1 and passesUPDATE: can confirm this is also broken in 4.14.0. so it might have been somewhere within that minor version change
The text was updated successfully, but these errors were encountered: