github devlooped/moq v4.14.0
4.14.0

latest releases: v4.20.72, v4.20.71, v4.20.70...
21 months ago

Added

  • A mock's setups can now be inspected and individually verified via the new Mock.Setups collection and IInvocation.MatchingSetup property (@stakx, #984-#987, #989, #995, #999)

  • New .Protected().Setup and Protected().Verify method overloads to deal with generic methods (@JmlSaul, #967)

  • Two new public methods in Times: bool Validate(int count) and string 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 in mock.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 like new Mock<C>(): a record of such invocations is retained in the mock's Invocations collection (@stakx, #980)

  • After updating Moq from 4.10.1 to 4.11, mocking NHibernate session throws a System.NullReferenceException (@ronenfe, #955)

Don't miss a new moq release

NewReleases is sending notifications on new releases.