Changed
- Improved performance for
Mock.Of<T>
andmock.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 returndefault(T)
for loose mocks, but a value that is consistent with the mock'sCallBase
andDefaultValue[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
, andmockRepository.OneOf
that accept aMockBehavior
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()
andMock.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).