Moq v4.14.0 Release Notes
Release Date: 2020-04-24 // over 2 years ago-
โ Added
A mock's setups can now be inspected and individually verified via the new
Mock.Setups
collection andIInvocation.MatchingSetup
property (@stakx, #984-#987, #989, #995, #999)New
.Protected().Setup
andProtected().Verify
method overloads to deal with generic methods (@JmlSaul, #967)Two new public methods in
Times
:bool Validate(int count)
andstring ToString()
(@stakx, 975)
๐ Changed
Attempts to mark conditionals setup as verifiable are now considered an error, since conditional setups are ignored during verification. Calls to
.Verifiable()
on conditional setups are no-ops and can be safely removed. (@stakx, #997)When matching invocations against setups, captured variables nested inside expression trees are now evaluated. Their values likely matter more than their identities. (@stakx, #1000)
๐ Fixed
Regression: Restored
Capture.In
use inmock.Verify(expression, ...)
to extract arguments of previously recorded invocations. (@vgriph, #968; @stakx, #974)Consistency: When mocking a class
C
whose constructor invokes one of its virtual members,Mock.Of<C>()
now operates likenew Mock<C>()
: a record of such invocations is retained in the mock'sInvocations
collection (@stakx, #980)After updating Moq from 4.10.1 to 4.11, mocking NHibernate session throws a
System.NullReferenceException
(@ronenfe, #955)