Moq v2.5 Release Notes
-
- ➕ Added support for mocking protected members
- ➕ Added new way of extending argument matchers which is now very straightforward
- ➕ Added support for mocking events
- ➕ Added support for firing events from expectations
- ✂ Removed usage of MBROs which caused inconsistencies in mocking features
- ➕ Added
ExpectGet
andExpectSet
to better support properties, and provide better intellisense. - ➕ Added verification with expressions, which better supports Arrange-Act-Assert testing model (can do
Verify(m => m.Do(...)))
- ➕ Added
Throws<TException>
- ➕ Added
mock.CallBase
property to specify whether the virtual members base implementation should be called - ➕ Added support for implementing and setting expectations and verifying additional interfaces in the mock, via the new
mock.As<TInterface>()
method (thanks Fernando Simonazzi!) - 👌 Improved argument type matching for
Is
/IsAny
(thanks Jeremy.Skinner!)