github devlooped/moq v4.12.0
4.12.0

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

Changed

  • Improved performance for Mock.Of<T> and mock.SetupAllProperties() as the latter now performs property setups just-in-time, instead of as an ahead-of-time batch operation. (@vanashimko, #826)
  • 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)

Added

  • New method overload sequenceSetup.ReturnsAsync(Func<T>) (@stakx, #841)
  • LINQ to Mocks support for strict mocks, i.e. new method overloads for Mock.Of, Mocks.Of, mockRepository.Of, and mockRepository.OneOf that accept a MockBehavior parameter. (@stakx, #842)

Fixed

  • Adding Callback to a mock breaks async tests (@marcin-chwedczuk-meow, #702)
  • mock.SetupAllProperties() now setups write-only properties for strict mocks, so that accessing such properties will not throw anymore. (@vanashimko, #836)
  • Regression: mock.SetupAllProperties() and Mock.Of<T> fail due to inaccessible property accessors (@Mexe13, #845)
  • Regression: VerifyNoOtherCalls causes stack overflow when mock setup returns the mocked object (@bash, #846)
  • Capture.In() no longer captures arguments when other setup arguments do not match (@ocoanet, #844).
  • CaptureMatch no longer invokes the capture callback when other setup arguments do not match (@ocoanet, #844).

Don't miss a new moq release

NewReleases is sending notifications on new releases.