All Versions
107
Latest Version
Avg Release Cycle
40 days
Latest Release
604 days ago

Changelog History
Page 4

  • v4.8.1 Changes

    January 08, 2018

    โž• Added

    • ๐Ÿคก C# 7 tuple support for DefaultValue.Empty and DefaultValue.Mock (@stakx, #563)

    ๐Ÿ”„ Changed

    • โฌ‡๏ธ Downgraded 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)

    ๐Ÿ›  Fixed

    • CallBase regression with explicitly implemented interface methods (@stakx, #558)
  • v4.8.0 Changes

    December 24, 2017

    ๐Ÿ‘€ Same as 4.8.0-rc1 (see below), plus some significant speed improvements.

    ๐Ÿ”„ Changed

    • ๐Ÿ‘ SetupAllProperties now fully supports property type recursion / loops in the object graph, thanks to deferred property initialization (@stakx, #550)
  • v4.8.0-rc1 Changes

    December 08, 2017

    ๐Ÿš€ This is a pre-release version.

    โž• Added

    • ๐Ÿ‘Œ Support for sequential setup of void methods (@alexbestul, #463)
    • ๐Ÿ‘Œ Support for sequential setups (SetupSequence) of protected members (@stakx, #493)
    • ๐Ÿ‘Œ Support for callbacks for methods having ref or out parameters via two new overloads of Callback and Returns (@stakx, #468)
    • ๐Ÿ‘Œ Improved support for setting up and verifying protected members (including generic methods and methods having by-ref parameters) via the new duck-typing mock.Protected().As<TAnalog>() interface (@stakx, #495, #501)
    • ๐Ÿ‘Œ Support for ValueTask<TResult> when using the ReturnsAsync extension methods, similar to Task<TResult> (@AdamDotNet, #506)
    • 0๏ธโƒฃ Special handling for ValueTask<TResult> with DefaultValue.Empty (@stakx, #529)
    • ๐Ÿ‘Œ Support for custom default value generation strategies besides DefaultValue.Empty and DefaultValue.Mock: Implement custom providers by subclassing either DefaultValueProvider or LookupOrFallbackDefaultValueProvider, install them by setting Mock[Repository].DefaultValueProvider (@stakx, #533, #536)
    • ๐Ÿ‘ Allow DefaultValue.Mock to mock Task<TMockable> and ValueTask<TMockable> (@stakx, #502)
    • Match any value for 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)

    ๐Ÿ”„ Changed

    • ๐Ÿ’ฅ Breaking change: 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)
    • Delegates passed to Returns are validated a little more strictly than before (return type and parameter count must match with method being set up) (@stakx, #520)
    • ๐Ÿ”„ Change assembly versioning scheme to major.minor.0.0 to help prevent assembly version conflicts and to reduce the need for binding redirects (@stakx, #554)

    ๐Ÿ›  Fixed

    • โšก๏ธ Update a method's invocation count correctly, even when it is set up to throw an exception (@stakx, #473)
    • Sequences set up with SetupSequence are now thread-safe (@stakx, #476)
    • ๐Ÿšš Record calls to methods that are named like event accessors (add_X, remove_X) so they can be verified (@stakx, #488)
    • ๐Ÿ‘Œ Improve recognition logic for sealed methods so that Setup throws when an attempt is made to set one up (@stakx, #497)
    • Let SetupAllProperties skip inaccessible methods (@stakx, #499)
    • ๐Ÿคก Prevent Moq from relying on a mock's implementation of IEnumerable<T> (@stakx, #510)
    • ๐Ÿšš Verification leaked internal MockVerificationException type; remove it (@stakx, #511)
    • ๐Ÿ–จ Custom matcher properties not printed correctly in error messages (@stakx, #517)
    • ๐Ÿคก Infinite loop when invoking delegate in Mock.Of setup expression (@stakx, #528)

    Obsoleted

    • ๐Ÿ—„ [Matcher] has been deprecated in favor of Match.Create (@stakx, #514)
  • v4.7.145 Changes

    November 06, 2017

    ๐Ÿ”„ Changed

    • ๐Ÿ‘€ Moq no longer collects source file information for verification error messages by default. A current .NET Framework regression (https://github.com/Microsoft/dotnet/issues/529) makes this extremely costly, so this is now an opt-in feature; see Switches.CollectSourceFileInfoForSetups (@stakx, #515)

    โž• Added

    • ๐Ÿคก Mock.Switches and MockRepository.Switches, which allow opting in and out of certain features (@stakx, #515)
  • v4.7.142 Changes

    October 11, 2017

    ๐Ÿ”„ Changed

    • โšก๏ธ Update package reference to Castle.Core (DynamicProxy) from version 4.2.0 to 4.2.1 due to a regression; see castleproject/Core#309 for details (@stakx, #482)

    ๐Ÿ›  Fixed

    • ๐Ÿ‘€ TypeLoadExceptions ("Method does not have an implementation") caused by the regression above, see e.g. #469 (@stakx, #482)
  • v4.7.137 Changes

    September 30, 2017

    ๐Ÿ”„ Changed

    • โšก๏ธ Update package reference to Castle.Core (DynamicProxy) from version 4.1.1 to 4.2.0, which uses a new assembly versioning scheme that should eventually reduce assembly version conflicts and the need for assembly binding redirects (@stakx, #459)

    ๐Ÿ›  Fixed

    • ๐Ÿคก mock.Object should always return the exact same proxy object, regardless of whether the mock has been cast to an interface via .As<T>() or not (@stakx, #460)
  • v4.7.127 Changes

    September 26, 2017

    ๐Ÿ”„ Changed

    • ๐Ÿ‘ป Make setups for inaccessible internal members fail fast by throwing an exception (@stakx, #455)

    โœ‚ Removed

    • ๐Ÿšš The redundant type ObsoleteMockException has been removed (@stakx)

    ๐Ÿ›  Fixed

    • ๐Ÿ‘‰ Make SetupAllProperties work correctly for same-typed sibling properties (@stakx, #442)
    • ๐Ÿ‘ Switch back from portable PDBs to classic PDBs for better compatibility of SourceLink with older .NET tools (@stakx, #443)
    • ๐Ÿคก Make strict mocks recognize that .CallBase() can set up a return value, too (@stakx, #450)
  • v4.7.99 Changes

    July 17, 2017

    โž• Added

    • โž• Add [NeutralResourcesLanguage] to assembly info for portable library use (@benbillbob, #394)
    • โž• Add portable, SourceLink-ed debugging symbols (PDB) to NuGet package, enabling end users to step into Moq's source code (@stakx, #417)

    ๐Ÿ”„ Changed

    • ๐Ÿšš Move all hardcoded message strings to Resources.resx (@stakx, #403)
    • โšก๏ธ Update package reference to Castle.Core (DynamicProxy) from version 4.1.0 to 4.1.1 (@stakx, #416)
    • ๐Ÿ— Clean up and simplify the build process by merging separate .NET Framework and .NET Standard projects (@stakx, #417)
    • ๐Ÿš€ Replace outdated ReleaseNotes.md with new CHANGELOG.md (@stakx, #423)

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix member name typo in reflection code (@JohanLarsson, #389)
    • ๐Ÿคก Make Interceptor more thread-safe during mock.Setup (@stakx, #392)
    • ๐Ÿ‘‰ Make abstract events defined in classes work even when CallBase is true by suppressing InvokeBase() (@stakx, #395)
    • ๐Ÿ‘ Allow setting up null return values using Mock.Of (@stakx, #396)
    • ๐Ÿ‘ Allow Mock<T>.Raise to raise events on child mocks instead of raising no or the wrong event (@stakx, #397)
    • ๐Ÿ‘Œ Improve specificity of Setup / Verify exception messages for static members and extension methods (@stakx, #400)
    • ๐Ÿคก Prevent internal interception on a mock from changing its DefaultValue property (@vladonemo, #411)
    • Prevent stack overflow in conditional setups (@stakx, #412)
    • ๐Ÿ›  Fix NullReferenceException caused by internally relying on a mock's IEnumerable implementation (@stakx, #413)
    • ๐Ÿ‘Œ Improve method match accuracy in ExtractProxyCall so that the order of setting up methods in an hierarchy of interfaces does not matter (@stakx, #415)
    • ๐Ÿ‘Œ Improve mockability of C++/CLI interfaces having custom modifiers (modopt, modreq) in their method signatures (@stakx, #416)
    • ๐Ÿคก Make types implementing the same generic type more than two times mockable (@stakx, #416)
    • ๐Ÿ›  Fix misreported Times in verification error messages (@stakx, #417)
  • v4.7.63 Changes

    June 21, 2017

    ๐Ÿ”„ Changed

    • Ensure that null never matches an It.IsRegex(โ€ฆ) (@stakx, #385)

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix mocking of non-virtual methods via mock.As<TInterface>() which was broken by #381 (@stakx, #387)
  • v4.7.58 Changes

    June 21, 2017

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix formatting inconsistencies for array values in MockException.Message (@stakx, #380)
    • ๐Ÿ›  Fix major "class method vs. interface method" bug introduced by #119 / commit 162a543 (@stakx, #381)
    • ๐Ÿ›  Fix mocking for redeclared interface properties (get-set but get-only in base type) (@stakx, #382)