NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet · #189 most downloaded on NuGet
NSubstitute is a friendly substitute for .NET mocking libraries. It has a simple, succinct syntax to help developers write clearer tests. NSubstitute is designed for Arrange-Act-Assert (AAA) testing and with Test Driven Development (TDD) in mind.
Last release 1 months ago
11 Aug 2026
Release timing varies
gaps range from 2 weeks to 1.7 years
Rarely documented
notes for 8 of 37 stable releases
13 versions withdrawn
withdrawn after publishing
127 years old
50 releases · first in 1900
This release improves generic call matching ( #989 , #974 , #990 ). Thanks to @zvirja and @JMolenkamp for fixes this. We've also switched to using tru
This release improves generic call matching (#989, #974, #990). Thanks to @zvirja and @JMolenkamp for fixes this.
We've also switched to using trusted nuget publishing linked to GitHub Releases. (#987, @zvirja)
Full Changelog: v6.1.0...v6.2.0
One column per quarter.
This release reverts nullability support introduced in 6.0. This change caused a number of problems for callers ( #973 , #976 ), and trying to resolve
This release reverts nullability support introduced in 6.0. This change caused a number of problems for callers (#973, #976), and trying to resolve these (#976) revealed the need for more fundamental changes to NSubstitute to effectively support this. As a result, nullability is again disabled for public API. Huge thanks to @jdb0123, @Romfos, and @Moha-sami for their PRs addressing this, and thanks for all those who raised issues. We also humbly award @zvirja with one unlimited "I told you so" pass to use as he sees fit.
Full Changelog: v6.0.0...v6.1.0
ℹ️ No changes from Release Candidate 1 .
ℹ️ No changes from Release Candidate 1.
From RC1 notes:
ArgMatchers.Matching predicate matcher as an alternative to Is(Expression<Predicate<T>>. (.NET6 and above.)Arg.Is now accepts arg matchers.Thank you to our first time contributors!
Thanks also to @304NotModified and @Romfos for their continued support and contributions to this release.
Full Changelog: v5.3.0...v6.0.0
[NEW] Introduced Substitute.ForTypeForwardingTo to create substitutes that forward interceptable calls to a concrete class. This provides an easy way
Substitute.ForTypeForwardingTo to create substitutes that forward interceptable calls to a concrete class. This provides an easy way of implementing a test spy over an existing type. Designed and implemented by @marcoregueira in #700 from a proposal by @wsaeed. Thanks to all who contributed to discussions of this feature.Thanks to first-time contributors @mihnea-radulescu and @marcoregueira! Thanks also @304NotModified and @Romfos for their continued support and contributions to this release.
Full Changelog: v5.2.0...v5.3.0
Changelog: https://github.com/nsubstitute/NSubstitute/blob/v5.1.0/CHANGELOG.md Breaking changes: NSubstitute Analyzers may produce false positives in…
We've released NSubstitute v5.1.0!
Changes:
Thanks a lot to all code contributors, reviewers, and people who have raised and/or commented on issues.
If you haven't already done so, please make sure you add the NSubstitute.Analyzers package wherever you reference NSubstitute: https://nsubstitute.github.io/help/nsubstitute-analysers/
As always, please raise an issue on GitHub if you have any problems.
Changelog: https://github.com/nsubstitute/NSubstitute/blob/v5.1.0/CHANGELOG.md
Breaking changes: NSubstitute Analyzers may produce false positives in some cases for Arg.AnyType. Follow nsubstitute/NSubstitute.Analyzers#212 for progress on this. These warnings can be suppressed if required.
Project links:
Changelog: https://github.com/nsubstitute/NSubstitute/blob/v5.0.0/CHANGELOG.md Breaking changes:
Hi all,
We've released NSubstitute v5.0.0. This release updates our target frameworks to the ones recommended by Microsoft: .NET 6+, .NET Framework 4.6.2+, .NET Standard 2.0+. Thanks to @Romfos for this change (#710), and @alexandrnikitin for the review and merge. Thanks also to @tillw for some clarifications to our docs on internal members (#706).
See full release notes here: https://github.com/nsubstitute/NSubstitute/releases/tag/v5.0.0
Thanks a lot to all code contributors, reviewers, and people who have raised and/or commented on issues.
If you haven't already done so, please make sure you add the NSubstitute.Analyzers package wherever you reference NSubstitute: https://nsubstitute.github.io/help/nsubstitute-analysers/
As always, please raise an issue on GitHub if you have any problems.
Changelog: https://github.com/nsubstitute/NSubstitute/blob/v5.0.0/CHANGELOG.md
Breaking changes:
Project links:
Full Changelog: v4.4.0...v5.0.0
Changelog: https://github.com/nsubstitute/NSubstitute/blob/v4.4.0/CHANGELOG.md Breaking changes: There should be no breaking changes with this release…
Hi all,
We've released NSubstitute v4.4.0. This adds support for Castle Core v5, thanks to @Havunen (#690, #673), as well as fixing an issue checking for constructor args on null object, courtesy of @phongphanq, and @appel1 (#683, #685). Thanks also to @Mandroide for the code review. @Socolin has also added .ThrowsAsync() that will correctly mock exceptions on async methods (#609, #663).
Thanks a lot to all code contributors, reviewers, and people who have raised and/or commented on issues.
If you haven't already done so, please make sure you add the NSubstitute.Analyzers package wherever you reference NSubstitute: https://nsubstitute.github.io/help/nsubstitute-analysers/
As always, please raise an issue on GitHub if you have any problems.
Changelog: https://github.com/nsubstitute/NSubstitute/blob/v4.4.0/CHANGELOG.md
Breaking changes: There should be no breaking changes with this release.
Project links:
.ThrowsAsync() that will correctly mock exception on async methods by @Socolin in #663ReturnsNull calls for nullable value types by @Stedoss in #692Full Changelog: v4.3.0...v4.4.0
Breaking changes: There should be no breaking changes with this release.
Hi everyone,
We've just released NSubstitute v4.3.0. This introduces support for .NET 5 (#636) and .NET 6 (#674). Thanks to @zvirja and @Havunen!
If you haven't already done so, please make sure you add the NSubstitute.Analyzers package wherever you reference NSubstitute: https://nsubstitute.github.io/help/nsubstitute-analysers/
As always, please raise an issue on GitHub or email the group if you have any problems.
Changelog: https://github.com/nsubstitute/NSubstitute/blob/v4.3.0/CHANGELOG.md
Breaking changes: There should be no breaking changes with this release.
Project links:
Full Changelog: v4.2.2...v4.3.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →