[ANN] NSubstitute 4.0.0-rc1 release candidate

Skip to first unread message

David Tchepak

Nov 18, 2018, 10:38:49 PM11/18/18
to nsubs...@googlegroups.com
Hi everyone,

We've released NSubstitute 4.0.0-rc1 to NuGet. Due to the scope of the changes in v4.0 we're starting with a release candidate to give people a chance to provide feedback prior to the final 4.0.0 release. This means to install it you'll need to tell NuGet to include prerelease packages: https://docs.microsoft.com/en-us/nuget/create-packages/prerelease-packages#installing-and-updating-pre-release-packages

This release has a significant number of new features, fixes and improvements, so please see the changelog for full details! I'll cover a few highlights here.

* New support for matching `out` and `ref` arguments with argument matchers

* `CallBase()` for enabling base method calls for existing substitutes. This provides another way of having partial mocking from NSubstitute.

* A new `Configure()` method which can be used to tell NSubstitute that we are configuring the next call, so it will not run any callbacks or call base methods of the substitute while that call is being configured.

* Improved performance

* Improved debugging, errors and error messages

* Improved documentation

There are a few potentially breaking changes for this release. Please see the link below for the full list. The main one is that argument matching for `out` and `ref` requires C# 7 features, so if you are stuck on an earlier compiler you will have to use one of the workarounds described in the Breaking Changes document. Please post to the list if you have any troubles migrating projects to 4.0 and I'm happy to provide suggestions to make the process easier. (See http://nsubstitute.github.io/help/compat-args/ for some options). Other breaking changes mainly relate to detecting problematic NSubstitute usage patterns, which will now throw as soon as they are detectable rather than leaking into other tests to cause problems. Those breaking changes generally indicate legitimate problems with that test that should be fixed (i.e. it's a good breaking change, not something completely inconvenient!)

This release has been largely driven and developed by core team member Alex Povar (@zvirja). Thanks Alex! Thanks also to @tpodolak for the huge amount of work that has gone in to the NSubstitute.Analyzers project. Thanks also to Alexandr Nikitin, @firelizzard18, @jsbed, Chris Maddock, Jim Aho, and Mathias Lorenzen for their contributions to this release!

As always, please raise an issue on GitHub (https://github.com/nsubstitute/NSubstitute/issues) or email the group if you have any problems.


Breaking Changes:

Project links:

Reply all
Reply to author
0 new messages