NSubstitute 5.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
.NET 6.0 .NET Standard 2.0 .NET Framework 4.6.2
dotnet add package NSubstitute --version 5.0.0
NuGet\Install-Package NSubstitute -Version 5.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NSubstitute" Version="5.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NSubstitute --version 5.0.0
#r "nuget: NSubstitute, 5.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NSubstitute as a Cake Addin
#addin nuget:?package=NSubstitute&version=5.0.0

// Install NSubstitute as a Cake Tool
#tool nuget:?package=NSubstitute&version=5.0.0

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.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (154)

Showing the top 5 NuGet packages that depend on NSubstitute:

Package Downloads
AutoFixture.AutoNSubstitute The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

This extension turns AutoFixture into an Auto-Mocking Container. The mock instances are created by NSubstitute. To use it, add the AutoNSubstituteCustomization to your Fixture instance.


Extension for mocking Entity Framework Core operations such ToListAsync, FirstOrDefaultAsync etc. When writing tests for your application it is often desirable to avoid hitting the database. The extension allows you to achieve this by creating a context – with behavior defined by your tests – that makes use of in-memory data.


Package Description


Some generic test utilites.


Helpers for testing when using PeanutButter.DatabaseHelpers

GitHub repositories (302)

Showing the top 5 popular GitHub repositories that depend on NSubstitute:

Repository Stars
.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
The core infrastructure backend (API, database, Docker, etc).
ASP.NET Boilerplate - Web Application Framework
Open Source Web Application Framework for ASP.NET Core. Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET and the ASP.NET Core platforms. Provides the fundamental infrastructure, production-ready startup templates, application modules, UI themes, tooling, guides and documentation.
Cloud Native application framework for .NET
Version Downloads Last updated
5.0.0 1,433,295 2/12/2023
4.4.0 5,789,072 7/10/2022
4.3.0 6,466,479 1/24/2022
4.2.2 20,197,991 6/13/2020
4.2.1 12,275,349 7/15/2019
4.2.0 2,074,519 5/19/2019
4.1.0 686,762 5/5/2019
4.0.0 3,111,283 1/30/2019
4.0.0-rc1 85,147 11/19/2018
3.1.0 11,322,815 10/27/2017
3.0.1 456,564 10/8/2017
2.0.3 6,112,455 4/25/2017
2.0.1-rc 151,960 12/17/2016
2.0.0-rc 177,320 8/7/2016
1.10.0 3,358,912 3/22/2016
1.9.2 1,251,017 10/22/2015
1.9.1 433,680 9/30/2015
1.8.2 971,411 5/29/2015
1.8.1 735,653 12/26/2014
1.8.0 127,381 11/11/2014
1.7.2 527,815 3/4/2014
1.7.1 215,270 1/16/2014
1.7.0 41,715 1/3/2014
1.6.1 272,052 6/30/2013
1.6.0 107,363 4/19/2013
1.5.0 319,170 1/25/2013
1.4.3 65,564 8/15/2012
1.4.2 26,948 7/1/2012
1.4.1 3,443 6/28/2012
1.4.0 40,629 5/4/2012
1.3.0 42,297 11/22/2011
1.2.1 7,876 10/10/2011
1.2.0 4,148 9/29/2011
1.1.0 40,363 5/21/2011
1.0.0 57,753 5/17/2011
0.9.5 4,202 1/7/2011 42,714 1/7/2011