Skip to content

Conversation

@renovate
Copy link

@renovate renovate bot commented Sep 16, 2025

Coming soon: The Renovate bot (GitHub App) will be renamed to Mend. PRs from Renovate will soon appear from 'Mend'. Learn more here.

This PR contains the following updates:

Package Change Age Confidence
Moq 4.7.99 -> 4.20.72 age confidence

Release Notes

moq/moq (Moq)

v4.20.72

Full Changelog

🔨 Other:

  • Question: Sponsorable Attribute in release v4.20.71 #​1513

🔀 Merged:

v4.20.71

Full Changelog

🐛 Fixed bugs:

🔨 Other:

  • Documentation Unavailable Online #​1473
  • Some source code files is filled with comments like: "Unmerged change from project " #​1451
  • Question: would it make sense to call verify all on a strict mock when the mock gets disposed? #​1440
  • SponsorLink Integration Makes Moq Unuasable due to PII and GDPR Requirements #​1433
  • Default value ILookup<> in loose mode is null #​1391
  • Verifying a protected method when the exact parameter types are not statically known #​1339

🔀 Merged:

v4.20.70

Full Changelog

🔨 Other:

  • a minor changes to improve the readability #​1419
  • Change log is not updated since version 4.18.4 #​1406
  • Stop using Moq as a guinea pig to get feedback on and develop SponsorLink #​1396
  • Permanently delete all data from SponsorLink's database that has been collected during builds that included Moq (notably any version 4.20.*) #​1395
  • SponsorLink is now OSS too and no longer bundled #​1384
  • Performance issue with large interfaces #​1350

🔀 Merged:

v4.20.69

Full Changelog

🔨 Other:

  • Trouble to unit test a lambda expression with Moq #​1387
  • Strange System.UnauthorizedAccessException during build using latest version #​1377
  • Privacy issues with SponsorLink, starting from version 4.20 #​1372
  • Upgrading to version 4.20.1 breaks the build #​1371
  • Warnings with latest version from SponsorLink #​1370
  • Missing License Information In Nuget metadata #​1348

🔀 Merged:

v4.20.2

Full Changelog

🐛 Fixed bugs:

🔨 Other:

  • Running unit tests through Rider causes AD0001 : Analyzer 'Moq.SponsorLinker' threw an exception of type 'System.UnauthorizedAccessException' #​1369

v4.20.1

Full Changelog

v4.20.0

Full Changelog

🔨 Other:

  • Documentation link in readme is broken #​1349

🔀 Merged:

v4.18.4

Full Changelog

✨ Implemented enhancements:

  • Is there a RaiseAsync method for raising Func<..., Task> events? #​1310
  • Provide a way to opt out of VerifyAll() #​937
  • Set Times expectation on Setup #​373
  • Add setup.Verifiable(Times times, [string failMessage]) method #​1319 (@​stakx)

🐛 Fixed bugs:

  • Verifying a protected generic method that returns a value is broken #​1314

🔨 Other:

  • invalid path on linux #​1353
  • Thread Safety issue in Moq reported by Infer# report #​1347
  • Moq should use CallBase to call default method from interfaces #​1345
  • Functionality Request. Verify Mock using the Mock Setup as base. #​1344
  • System.ArgumentException : Object of type 'Microsoft.DurableTask.TaskName' cannot be converted to type 'System.String' #​1343
  • Appveyor (CI): Strong name signature verification error fails builds & blocks next version release #​1340
  • Mocking derived classes of Exception results in .Object being null #​1337
  • base class can not be mocked #​1332
  • Verify(It.Is<T>(t => t.SomeProperty.Equals("SomeValue")), Times.Exactly(x)) isn't working as expected #​1331
  • Add/support Target Framework net7.0 #​1327
  • Mock method with Expression as parameter. #​1324
  • System.TypeLoadException : Could not load type 'Castle.Core.Internal.CollectionExtensions' from assembly 'Castle.Core, Version=5.0.0.0 after updating to Moq 4.18.4 #​1320
  • Weird exception when mocking interface with SignalRHubAttribute applied #​1308

🔀 Merged:

v4.18.3

Full Changelog

✨ Implemented enhancements:

  • Improve a exception message for extension methods. #​1305
  • Mocking a method that takes an in parameter #​1301

🐛 Fixed bugs:

  • .NET Hot Reload breaks mocked interfaces and throws IndexOutOfRangeException #​1252

🔨 Other:

  • Ignoring latest setup #​1311
  • Invocation count incorrect. Argument object is stored as reference and is changed incorrectly #​1309
  • Moq 4.18.3 Release still pending #​1302
  • Moq fails when a method with input parameter of type Expression<Func<T,bool>> is called #​1288
  • Use Moq as a proxy #​1287
  • TargetParameterCountException when using event Raise with Moq #​1285
  • Add CITATION.cff file #​1266
  • MissingMethodException when using new C# language features (in parameters, init-only setters, etc.) with generic methods, or with members in generic types #​1148

🔀 Merged:

v4.18.2

Full Changelog

🐛 Fixed bugs:

  • "Expression is not an event add" when using .Raises() #​1175

🔨 Other:

  • Improperly throws System.TypeLoadException on mock when a record has a base record on dotnet 6 #​1273
  • Performance Issues After Version 4.12.0 #​1269
  • Mixing "property behavior" and "Setup for properties" broken (or at least changed) in 4.17.1 #​1265
  • MissingMethodException when mocking interface with sealed default implementation #​1209
  • Can't raise non-virtual async event #​977

🔀 Merged:

v4.18.1

Full Changelog

✨ Implemented enhancements:

  • [Feature Request] Allow to change MockBehavior of mocks #​1230

🐛 Fixed bugs:

  • Difference in behavior when mocking async method using .Result vs without #​1253
  • Setup property doesn't work as expected #​1248
  • Update from 4.13.1 to 4.16.1 lazy evaluation setups fail #​1217

🔨 Other:

  • Absence of a clause in the documentation about the lack of support for sealed methods #​1256
  • moqthis.com is down #​1244
  • Setup return value fails in a constellation with nullable ints #​1223

🔀 Merged:

v4.18.0

Full Changelog

🐛 Fixed bugs:

  • Failure when invoking a method with by-ref parameter & mockable return type on a mock with CallBase and DefaultValue.Mock configured #​1249
  • Placeholder in exception is not filled out #​1246

🔨 Other:

  • sealed method mock calls actual method instead of mocked #​1255
  • Unable to call base interface getter with cast without explicit setup. #​1254
  • Moq is using Castle.Core which has an old version of System.Net.Http which is vulnerable to "DoS", "Spoofing", "Privilege Escalation", "Authentication Bypass" and "Information Exposure" #​1219
  • Can't set up "private protected" properties #​1170

🔀 Merged:

v4.17.2

Full Changelog

🐛 Fixed bugs:

  • Property stubs not working on sub mock #​1240

🔨 Other:

  • Add support for success condition parameter in When. #​1237

🔀 Merged:

v4.17.1

Full Changelog

🐛 Fixed bugs:

  • SetupAllProperties causes mocks to become race-prone #​1231
  • Property setups are ignored on mocks instantiated using Mock.Of #​1066

🔨 Other:

  • It.IsSubtype<T> doesn't work when T has constraints #​1215

🔀 Merged:

v4.16.1

Full Changelog

✨ Implemented enhancements:

  • Access invocation arguments when using Throws/ThrowsAsync during Setup #​1048
  • Enable multi-method setups #​1203 (@​stakx)

🐛 Fixed bugs:

  • Moq.Verify cant detect Invocation when a method is passed #​1225
  • implicit guard too strict; prevents valid user wildcard _ implementations #​1199
  • Parameter is invalid in Protected().SetupSet() method #​1184
  • Issue mocking Vb.Net class with overloaded property in base class #​1153

🔨 Other:

  • Poor error message mocking a non-virtual Set property #​1228
  • Calling .Raise raises the event on a new instance of the mocked object #​1221
  • Null reference exception when using the "new" keyword with properties #​1216
  • Specifying the expected number of occurrences in IsIn() #​1214
  • Moq 4.16.1 is not compatible with netcoreapp3.1 #​1212
  • Using type matchers with .Callback and .Returns should be forbidden #​1205
  • Add README to NuGet package #​1194
  • mock.Protected() setup methods fail when argument is of type Expression #​1188
  • Mock.Verify susceptible to reference type alterations #​1187
  • System.CommandLine CLI parsing library won't call a method on a mocked object #​1182
  • When testing a method which overrides a method in the base class, the unit test always passes. #​1180
  • The type initializer for 'Moq.Async.AwaitableFactory' threw an exception: Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.1 #​1179
  • Need a better way to manage parent class child class relationships #​1176
  • Setup a method with argument of interface type doesn't work when a not null instance is passed to that method #​1172
  • Extension methods (here: ServiceProviderServiceExtensions.GetRequiredService) may not be used in setup / verification expressions. #​1171
  • High severity vulnerabilities identified with the dependency package used in Moq 4.16.1 #​1169
  • Expected invocation on the mock should never have been performed, but was 1 times. when upgrading to the latest moq version 4.16.1 from 4.10.0 #​1168
  • Missing setter functionality from ProtectedAsMock #​1164
  • ProtectedAsMock issues #​1162
  • Mock an auto-derived interface with all getter-only properties having settings, too #​1158
  • Moq setup mismatches generic methods with derived generic arguments #​1157
  • GetHashCode() issues when called from inside constructor of mocked class #​1156
  • MissingMethodException when Verify Method with Array of ValueTuple #​1154
  • DefaultValue.Mock lazy initialization #​1149
  • Test method throwing exception with C# 9.0 init keyword #​1147
  • Intermittent System.TypeLoadExceptions and System.Security.VerificationExceptions #​1145
  • Using object parameter in callback function in place of It.IsAnyType throws exception #​1137
  • Mocking a method with "in" parameter of generic type #​1136
  • Get DocFX documentation online #​1090
  • Issue with selecting a constructor with null value #​969

🔀 Merged:

v4.16.0

Full Changelog

✨ Implemented enhancements:

🐛 Fixed bugs:

  • System.InvalidOperationException because of call to Verifiable in MockSequence after 4.14.0 #​1114

🔨 Other:

  • Please document generic argument matching support for versions prior to 4.13 #​1119
  • Verify is not capturing a classes state at the time of invocation. #​1118
  • Adding a setup looks like it became an O(n*n) operation since #​984 was merged #​1110
  • DbSet mocking is broken #​1091

🔀 Merged:

v4.15.2

Full Changelog

🔨 Other:

  • moq is not compatible with System.Threading.Tasks.Extensions 4.5.3 or 4.5.4 #​1107
  • Hi There, I just updated Moq package from version 4.14.7 to version 4.15.1 and noticed that it broke Unit Tests for my projects. Kindly look into this matter. Thanks in advance, Regards, Asheesh Agrawal #​1103
  • VerifyNoOtherCalls is failing a lot for existing tests due to unverified event registrations #​1102

🔀 Merged:

v4.15.1

Full Changelog

🔨 Other:

  • moq is not compatible with System.Threading.Tasks.Extensions 4.5.3 or 4.5.4 #​1107
  • Hi There, I just updated Moq package from version 4.14.7 to version 4.15.1 and noticed that it broke Unit Tests for my projects. Kindly look into this matter. Thanks in advance, Regards, Asheesh Agrawal #​1103
  • VerifyNoOtherCalls is failing a lot for existing tests due to unverified event registrations #​1102

🔀 Merged:

v4.14.7

Full Changelog

🔨 Other:

  • moq is not compatible with System.Threading.Tasks.Extensions 4.5.3 or 4.5.4 #​1107
  • Hi There, I just updated Moq package from version 4.14.7 to version 4.15.1 and noticed that it broke Unit Tests for my projects. Kindly look into this matter. Thanks in advance, Regards, Asheesh Agrawal #​1103
  • VerifyNoOtherCalls is failing a lot for existing tests due to unverified event registrations #​1102

🔀 Merged:

v4.14.6

Full Changelog

🐛 Fixed bugs:

  • Mock.Of<T>((m) => ...) doesn't play well with Microsoft IOptions<T> #​1039

🔨 Other:

  • Unable to build Moq: "The Microsoft.Build.Tasks.Git.LocateRepository task failed unexpectedly." #​1060
  • [Feature request] Loose mode for commands and strict for queries. #​1056
  • ThrowsAnyAsync<> not validating type #​1050
  • Mock methods that take or return a Span<T> #​1049
  • Feature request: enable verification of extension-methods calls #​1045

🔀 Merged:

v4.14.5

Full Changelog

🐛 Fixed bugs:

  • VerifySet breaks with System.NullReferenceException for WriteOnly-Indexed-Properties #​1036

🔀 Merged:

v4.14.4

Full Changelog

🐛 Fixed bugs:

  • NullReferenceException on subsequent setup if expression contains null reference #​1031

🔨 Other:

  • Do we still need to use DynamicProxy's AttributesToAvoidReplicating? #​1026

🔀 Merged:

v4.14.3

Full Changelog

🐛 Fixed bugs:

  • Verify behavior change using DefaultValue.Mock 4.12.0 vs 4.13.0 #​1024

🔀 Merged:

v4.14.2

Full Changelog

🔨 Other:

  • API Documentation page broken. #​1023
  • System.IO.FileNotFoundException thrown when referencing same DLL name with 2 different assembly versions within a single application #​1019

🔀 Merged:

  • DefaultValue.Mock should not add redundant setups for already-matched invocations #​1025 (@​stakx)

v4.14.1

Full Changelog

✨ Implemented enhancements:

  • ISetupSequentialResult doesn't support Pass for async void methods. #​993

🐛 Fixed bugs:

  • StackOverflowException on VerifyAll when mocked method returns mocked object #​1012

🔨 Other:

  • Function match should catch exception? #​1010
  • NullReferenceException in IMatcher.Matches #​1005
  • Async Method Support Clean-up #​384

🔀 Merged:

v4.14.0

Full Changelog

✨ Implemented enhancements:

  • Expose Moq.Times' Verify and Kind #​970
  • After updating moq from 4.10.1 to 4.11, mocking nhibernate session throws a System.NullReferenceException. #​955
  • Callback and Returns: Allow callback parameters to have type object where a type matcher was used #​953
  • Expose Mock.Setups, part 4: Mock, fluent setup & inner mock discovery #​989 (@​stakx)
  • add support for mocking protected generic methods #​967 (@​JmlSaul)

🐛 Fixed bugs:

  • Capture.In during Verify stopped working when upgrading Moq from 4.10.1 to 4.13.1 #​968

🔨 Other:

  • Build fails with error CS8751: Internal error in the C# compiler #​994
  • Call times verification change from 4.11.0 #​990
  • Mocked method call with multiple specific parameter call returns null #​973
  • IDE0008 Use explicit type instead of 'var' #​971
  • Maintainer on vacation until mid-March 2020 #​966
  • System.NullReferenceException : Object reference not set to an instance of an object. #​965
  • How do you mock an IAsyncEnumerable<T> ? #​962
  • Update from 4.9.0 to upper version breaks Setup out-param method #​960
  • If When(Func<bool> condition) is used to setup a mock, the setup verification is skipped. #​959

🔀 Merged:

v4.13.1

Full Changelog

✨ Implemented enhancements:

  • Expose Moq.Times' Verify and Kind #​970
  • After updating moq from 4.10.1 to 4.11, mocking nhibernate session throws a System.NullReferenceException. #​955
  • Callback and Returns: Allow callback parameters to have type object where a type matcher was used #​953
  • Expose Mock.Setups, part 4: Mock, fluent setup & inner mock discovery #​989 (@​stakx)
  • add support for mocking protected generic methods #​967 (@​JmlSaul)

🐛 Fixed bugs:

  • Capture.In during Verify stopped working when upgrading Moq from 4.10.1 to 4.13.1 #​968

🔨 Other:

  • Build fails with error CS8751: Internal error in the C# compiler #​994
  • Call times verification change from 4.11.0 #​990
  • Mocked method call with multiple specific parameter call returns null #​973
  • IDE0008 Use explicit type instead of 'var' #​971
  • Maintainer on vacation until mid-March 2020 #​966
  • System.NullReferenceException : Object reference not set to an instance of an object. #​965
  • How do you mock an IAsyncEnumerable<T> ? #​962
  • Update from 4.9.0 to upper version breaks Setup out-param method #​960
  • If When(Func<bool> condition) is used to setup a mock, the setup verification is skipped. #​959

🔀 Merged:

v4.13.0

Full Changelog

✨ Implemented enhancements:

  • Method without setup not return null #​897
  • Support expression-based mock creation for constructor calls that takes parameters #​884
  • Need a way to verify that code added an event handler to an event #​825
  • Invocations.Clear() does not cause Verify to fail. #​733
  • Open Generic Method Callback #​343
  • #​825 event handlers setup and verify #​857 (@​lepijohnny)

🐛 Fixed bugs:

  • Parameter types are ignored when matching an invoked generic method against setups #​903
  • Regression in 4.12.0: SetupAllProperties resets indexer setups #​901
  • Moq does not distinguish between distinct events if they have the same name #​893
  • Verify throws TargetInvocationException instead of MockException when SetupSequence includes returning a Task.FromException and the mocked method is not called enough times. #​883
  • MockDefaultValueProvider will try to set 'Callbase' on auto-generated mocks for delegates. #​874
  • SetupAllProperties() and Mock.Of<T> regression in Moq 4.12.0 #​870
  • Moq does not mock 'Explicit Interface Implementation' and 'protected virtual' correctly #​657

🔨 Other:

  • Strange behavior with dynamic + indexed property #​913
  • Permission to wrap & distribute as a COM library under GPLv3? #​910
  • Check ReturnsAsync method for null arguments. #​909
  • New method matching algorithm introduces behavioral change wrt return types #​906
  • Feature to reset setups and event handlers? #​889
  • Behavioural change between 4.11 -> 4.12 with CallBase=True and params args #​877
  • Project with Moq and explicit dependency on higher System.Threading.Tasks.Extension throw exception!! #​873
  • Callback with specific object type fails when not after a Return #​872
  • Regression for event subscription between 4.10 and 4.11 #​867
  • Linux compilation fails using Mono on Moq 4.8+ #​864
  • Intermittent AccessViolationException in Mock<>.Object #​860
  • Allow specifying action if setup was not met in strict mode #​856
  • System.Threading.Tasks.Dataflow FileLoadException #​855
  • Usage of Nunit SameAsConstraint (Is.SameAs(...)) in mock verification leads to incorrect result #​853
  • Improve "Member x does not exist" failure message #​852
  • SetupAllProperties and SetupProperty behave differently with respect to verification #​850

🔀 Merged:


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/moq-4.x branch 4 times, most recently from b58f605 to 36b7dba Compare September 18, 2025 12:07
@renovate renovate bot force-pushed the renovate/moq-4.x branch from 36b7dba to a9e03db Compare September 18, 2025 12:38
@dkropachev
Copy link
Collaborator

Dropped in favor of #125

@dkropachev dkropachev closed this Sep 18, 2025
@renovate
Copy link
Author

renovate bot commented Sep 18, 2025

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (4.20.72). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate renovate bot deleted the renovate/moq-4.x branch September 18, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants