Added
SetupSet
,VerifySet
methods formock.Protected().As<>()
(@tonyhallett, #1165)- New
Throws
method overloads that allow specifying a function with or without parameters, to provide an exception, for example.Throws(() => new InvalidOperationException())
andSetup(x => x.GetFooAsync(It.IsAny<string>()).Result).Throws((string s) => new InvalidOperationException(s))
. (@adam-knights, #1191)
Changed
Fixed
- The guard against unmatchable matchers (added in #900) was too strict; relaxed it to enable an alternative user-code shorthand
_
forIt.IsAny<>()
(@adamfk, #1199) mock.Protected()
setup methods fail when argument is of typeExpression
(@tonyhallett, #1189)- Parameter is invalid in
Protected().SetupSet()
...VerifySet
(@tonyhallett, #1186) - Virtual properties and automocking not working for
mock.Protected().As<>()
(@tonyhallett, #1185) - Issue mocking VB.NET class with overloaded property/indexer in base class (@myurashchyk, #1153)
- Equivalent arrays don't test equal when returned from a method, making
Verify
fail when it should not (@evilc0, #1225) - Property setups are ignored on mocks instantiated using
Mock.Of
(@stakx, #1066) SetupAllProperties
causes mocks to become race-prone (@estrizhok, #1231)