Bot releases are visible (Hide)
Full Changelog: https://github.com/devlooped/moq/compare/v4.20.69...v4.20.70
Published by kzu about 1 year ago
Let's make it more memorable when Moq became "safe" again.
Published by kzu about 1 year ago
NOTE: in addition, there were potential privacy issues raised with regards to the SHA256 hashing of
user' email to check for sponsorship, so it won't be coming back until that's properly addressed
Full Changelog: https://github.com/moq/moq/compare/v4.20.1...v4.20.2
Published by kzu about 1 year ago
Full Changelog: https://github.com/moq/moq/compare/v4.20.0...v4.20.1
Published by kzu about 1 year ago
setup.Verifiable(Times times, [string failMessage])
method by @stakx in https://github.com/moq/moq/pull/1319
Mock<T>.RaiseAsync
by @stakx in https://github.com/moq/moq/pull/1313
ThrowsAsync
for non-generic ValueTask
by @johnthcall in https://github.com/moq/moq/pull/1235
mock.Protected().Verify<T>()
method overload by @stakx in https://github.com/moq/moq/pull/1325
Full Changelog: https://github.com/moq/moq/compare/v4.18.4...v4.20.0
Published by kzu about 1 year ago
Full Changelog: https://github.com/moq/moq/compare/v4.20.0-beta...v4.20.0-rc
Published by kzu about 1 year ago
setup.Verifiable(Times times, [string failMessage])
method by @stakx in https://github.com/moq/moq/pull/1319
Mock<T>.RaiseAsync
by @stakx in https://github.com/moq/moq/pull/1313
ThrowsAsync
for non-generic ValueTask
by @johnthcall in https://github.com/moq/moq/pull/1235
mock.Protected().Verify<T>()
method overload by @stakx in https://github.com/moq/moq/pull/1325
Full Changelog: https://github.com/moq/moq/compare/v4.18.4...v4.20.0-beta
Published by kzu about 1 year ago
setup.Verifiable(Times times, [string failMessage])
method by @stakx in https://github.com/moq/moq/pull/1319
Mock<T>.RaiseAsync
by @stakx in https://github.com/moq/moq/pull/1313
ThrowsAsync
for non-generic ValueTask
by @johnthcall in https://github.com/moq/moq/pull/1235
mock.Protected().Verify<T>()
method overload by @stakx in https://github.com/moq/moq/pull/1325
Full Changelog: https://github.com/moq/moq/compare/v4.18.4...v4.20.0-alpha
Published by stakx almost 2 years ago
Same as 4.8.0 Release Candidate 1, plus some significant speed improvements.
SetupAllProperties
now fully supports property type recursion / loops in the object graph, thanks to deferred property initialization (@stakx, #550)Published by stakx almost 2 years ago
This is a pre-release version.
void
methods (@alexbestul, #463)SetupSequence
) of protected members (@stakx, #493)ref
or out
parameters via two new overloads of Callback
and Returns
(@stakx, #468)mock.Protected().As<TAnalog>()
interface (@stakx, #495, #501)ValueTask<TResult>
when using the ReturnsAsync
extension methods, similar to Task<TResult>
(@AdamDotNet, #506)ValueTask<TResult>
with DefaultValue.Empty
(@stakx, #529)DefaultValue.Empty
and DefaultValue.Mock
:DefaultValueProvider
or LookupOrFallbackDefaultValueProvider
,Mock[Repository].DefaultValueProvider
(@stakx, #533, #536)DefaultValue.Mock
to mock Task<TMockable>
and ValueTask<TMockable>
(@stakx, #502)ref
parameters with It.Ref<T>.IsAny
(or ItExpr.Ref<T>.IsAny
for protected methods) as you would with It.IsAny<T>()
for regular parameters (@stakx, #537)Mock.VerifyNoOtherCalls()
to check whether all expected invocations have been verified -- can be used as an alternative to MockBehavior.Strict
(@stakx, #539)SetupSequence
now overrides pre-existing setups like all other Setup
methods do. This means that exhausted sequences no longer fall back to previous setups to produce a "default" action or return value. (@stakx, #476)Returns
are validated a little more strictly than before (return type and parameter count must match with method being set up) (@stakx, #520)major.minor.0.0
to help prevent assembly version conflicts and to reduce the need for binding redirects (@stakx, #554)SetupSequence
are now thread-safe (@stakx, #476)add_X
, remove_X
) so they can be verified (@stakx, #488)Setup
throws when an attempt is made to set one up (@stakx, #497)SetupAllProperties
skip inaccessible methods (@stakx, #499)IEnumerable<T>
(@stakx, #510)MockVerificationException
type; remove it (@stakx, #511)Mock.Of
setup expression (@stakx, #528)[Matcher]
has been deprecated in favor of Match.Create
(@stakx, #514)Published by stakx almost 2 years ago
DefaultValue.Empty
and DefaultValue.Mock
(@stakx, #563)System.Threading.Tasks.Extensions
and System.ValueTuple
dependencies to versions 4.3.0 as suggested by @tothdavid in order to improve Moq compatibility with .NET 4.6.1 / help prevent MissingMethodException
and similar (@stakx, #571)CallBase
regression with explicitly implemented interface methods (@stakx, #558)Published by stakx almost 2 years ago
System.ValueTuple
dependency to version 4.4.0 in order to reestablish Moq compatibility with .NET 4.7 (and later), which already include the ValueTuple
types (@stakx, #591)Callback
and Returns
(@Caraul, #575)CallBase
regression with members of additional interfaces (@stakx, #583)Published by stakx almost 2 years ago
ISetupSequentialResult<TResult>.Returns
method overload that support delegate for deferred results (@snrnats, #594)in
parameter modifier (@stakx, #624, #625)ReturnsAsync
and ThrowsAsync
for sequential setups of methods returning a ValueTask
(@stakx, #626)ReturnsAsync
and ThrowsAsync
setup methods now consistently return a new Task
on each invocation (@snrnats, #595)Mock.Of<T>()
by approx. one order of magnitude (@informatorius, #598)Castle.Core
(DynamicProxy) from version 4.2.1 to 4.3.0 (@stakx, #624)ReturnsExtensions.ThrowsAsync()
can cause UnobservedTaskException
(@snrnats, #595)ReturnsAsync
and ThrowsAsync
with delay parameter starts timer at setup (@snrnats, #595)Returns
regression with null function callback (@Caraul, #602)Published by stakx almost 2 years ago
Mock.Invocations
property to support inspection of invocations on a mock (@Tragedian, #560)Castle.Core
(DynamicProxy) from version 4.3.0 to 4.3.1 (@stakx, #635)CallBase
disregarded for some base methods from non-public interfaces (@stakx, #641)mock.ResetCalls()
has been deprecated in favor of mock.Invocations.Clear()
(@stakx, #633)Published by stakx almost 2 years ago
ExpressionCompiler
: An extensibility point for setting up alternate LINQ expression tree compilation strategies (@stakx, #647)setup.CallBase()
for void
methods (@stakx, #664)VerifyNoOtherCalls
for MockRepository
(@BlythMeister, #682)VerifyNoOtherCalls
take into account previous calls to parameterless Verify()
and VerifyAll()
(@stakx, #659)VerifyAll
now succeeds after a call to SetupAllProperties
even when not all property accessors were invoked (stakx, #684)out
parameter detection for mocking COM interfaces with [in,out]
parameters (@koutinho, #645)Returns
callback methods that have been compiled from Expression
s (@stakx, #654)Verify
exception should report configured setups for delegate mocks (@stakx, #679)Verify
exception should include complete call expression for delegate mocks (@stakx, #680)VerifyAll
fail" (@stakx, #684)VerifyAll
behavior" (@stakx, #684)Published by stakx almost 2 years ago
NullReferenceException
when using SetupSet
on indexers with multiple parameters (@idigra, #694)CallBase
should not be allowed for delegate mocks (@tehmantra, #706)System.ValueTuple
NuGet package, at no functional cost (i.e. value tuples are still supported just fine) (@stakx, #721)System.Reflection.TypeExtensions
and System.Threading.Tasks.Extensions
dependencies to versions 4.5.1 (@stakx, #729)Published by stakx almost 2 years ago
This is a pre-release version.
It contains several minor breaking changes, and there have been extensive internal rewrites in order to fix some very long-standing bugs in relation to argument matchers in fluent setup expressions.
The library now targets .NET Standard 2.0 instead of .NET Standard 1.x. This has been decided based on the official cross-platform targeting guideline and the End of Life announcement for .NET Core 1.x (@stakx, #784, #785)
Method overload resolution may change for:
mock.Protected().Setup("VoidMethod", ...)
mock.Protected().Verify("VoidMethod", ...)
mock.Protected().Verify<TResult>("NonVoidMethod", ...)
due to a new overload: If the first argument is a bool
, make sure that argument gets interpreted as part of args
, not as exactParameterMatch
(see also Added section below). (@stakx & @Shereef, #751, #753)
mock.Verify[All]
now performs a more thorough error aggregation. Error messages of inner/recursive mocks are included in the error message using indentation to show the relationship between mocks. (@stakx, #762)
mock.Verify
no longer creates setups, nor will it override existing setups, as a side-effect of using a recursive expression. (@stakx, #765)
More accurate detection of argument matchers with SetupSet
and VerifySet
, especially when used in fluent setup expressions or with indexers (@stakx, #767)
mock.Verify(expression)
error messages now contain a full listing of all invocations that occurred across all involved mocks. Setups are no longer listed, since they are completely irrelevant in the context of call verification. (@stakx, #779, #780)
Indexers used as arguments in setup expressions are now eagerly evaluated, like all other properties already are (except when they refer to matchers) (@stakx, #794)
Update package reference to Castle.Core
(DynamicProxy) from version 4.3.1 to 4.4.0 (@stakx, #797)
New method overloads:
mock.Protected().Setup("VoidMethod", exactParameterMatch, args)
mock.Protected().Verify("VoidMethod", times, exactParameterMatch, args)
mock.Protected().Verify<TResult>("NonVoidMethod", times, exactParameterMatch, args)
having a bool exactParameterMatch
parameter. Due to method overload resolution, it was easy to think this already existed when in fact it did not, leading to failing tests. (@Shereef & @stakx, #753, #751)
Ability in mock.Raise
and setup.Raises
to raise events on sub-objects (inner mocks) (@stakx, #772)
InvalidOperationException
when specifiying setup on mock with mock containing property of type Nullable<T>
(@dav1dev, #725)Verify
gets confused between the same generic and non-generic signature (@lepijohnny, #749)Verify
despite being "unreachable" (@stakx, #703)Verify
can create setups that cause subsequent VerifyAll
to fail (@stakx & @lepijohnny, #699)mock.Raise
throws (@MutatedTomato, #738)Mock.Raise
only raises events on root object (@hallipr, #166)It.IsAny()
as the value, even if given in the indexer argument (@idigra, #696)VerifySet
fails on non-trivial property setup (@TimothyHayes, #430)SetupSet
'forgets' method setup (@TimothyHayes, #432)Verify[All]
fails because of lazy (instead of eager) setup argument expression evaluation (@aeslinger, #711)ArgumentOutOfRangeException
when setup expression contains indexer access (@mosentok, #714)Times.Equals
(@stakx, #805)Published by stakx almost 2 years ago
This is a pre-release version.
Moq.pdb
) have moved into a separate NuGet symbol package (as per the current official guideline). If you want the Visual Studio debugger to step into Moq's source code, disable Just My Code, enable SourceLink, and configure NuGet's symbol server. (@stakx, #789)SetupProperty
(@stakx, #823)Published by stakx almost 2 years ago
Same as 4.11.0 Release Candidate 2. See changelog entries for the two pre-release versions.
Published by stakx almost 2 years ago
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).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)sequenceSetup.ReturnsAsync(Func<T>)
(@stakx, #841)Mock.Of
, Mocks.Of
, mockRepository.Of
, and mockRepository.OneOf
that accept a MockBehavior
parameter. (@stakx, #842)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)mock.SetupAllProperties()
and Mock.Of<T>
fail due to inaccessible property accessors (@Mexe13, #845)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).