Skip to content

Update dependency Moq to 4.20.72 - autoclosed#207

Closed
renovate[bot] wants to merge 1 commit intomainfrom
renovate/moq-4.x
Closed

Update dependency Moq to 4.20.72 - autoclosed#207
renovate[bot] wants to merge 1 commit intomainfrom
renovate/moq-4.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Feb 7, 2026

This PR contains the following updates:

Package Change Age Confidence
Moq 4.13.14.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:


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 is behind base branch, 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 requested a review from a team as a code owner February 7, 2026 07:10
@renovate renovate Bot requested a review from mthadley February 7, 2026 07:10
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 7, 2026

Greptile Overview

Greptile Summary

Updates the Moq testing library from version 4.13.1 to 4.20.72 in the test project. This version jump brings numerous improvements:

  • Bug fixes: Resolved issues with property setups, verification methods, protected generic methods, and DefaultValue.Mock behavior
  • Performance improvements: Fixed slow setup operations for mocks with many setups, improved interface mocking performance
  • SponsorLink removal: Versions 4.20.0-4.20.2 included the controversial SponsorLink feature which was later removed in 4.20.70+
  • Compatibility: Updated to Castle.Core 5.1.1 (DynamicProxy) for better C# 9+ support including records and init-only setters
  • API enhancements: Added new features like RaiseAsync, ThrowsAsync for ValueTask, .Result property setup support, and Verifiable(Times) overloads

The codebase uses standard Moq patterns (Mock<HttpClientHandler>, .Protected(), Setup, Verify, ItExpr) that remain fully compatible with version 4.20.72. No code changes required.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • This is a standard dependency update for a testing library (Moq) that is isolated to the test project only and does not affect production code. The version jump (4.13.1 to 4.20.72) includes bug fixes, performance improvements, and removal of the controversial SponsorLink feature. The codebase uses standard Moq patterns (Mock<>, Setup, Verify, Protected()) that remain compatible across these versions. No breaking changes affect the existing test code.
  • No files require special attention

Important Files Changed

Filename Overview
test/WorkOSTests/WorkOSTests.csproj Updated Moq dependency from 4.13.1 to 4.20.72 in test project only

Sequence Diagram

sequenceDiagram
    participant RenovateBot
    participant TestProject as WorkOSTests.csproj
    participant NuGet as NuGet Package Manager
    participant Moq as Moq Library

    RenovateBot->>TestProject: Update Moq version reference
    Note over TestProject: Change version from<br/>4.13.1 to 4.20.72
    
    TestProject->>NuGet: Restore packages
    NuGet->>Moq: Download Moq 4.20.72
    NuGet->>NuGet: Download Castle.Core 5.1.1<br/>(transitive dependency)
    Moq-->>NuGet: Return package
    NuGet-->>TestProject: Packages restored
    
    TestProject->>TestProject: Compile test project
    Note over TestProject: Existing test code remains<br/>compatible with new version
    TestProject->>TestProject: Run tests
    Note over TestProject: Tests execute using<br/>updated Moq library
Loading

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@renovate renovate Bot changed the title Update dependency Moq to 4.20.72 Update dependency Moq to 4.20.72 - autoclosed Feb 23, 2026
@renovate renovate Bot closed this Feb 23, 2026
@renovate renovate Bot deleted the renovate/moq-4.x branch February 23, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

0 participants