NSubstitute 4.3.0 The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved

.NET 5.0 .NET Standard 1.3 .NET Framework 4.5
Install-Package NSubstitute -Version 4.3.0
dotnet add package NSubstitute --version 4.3.0
<PackageReference Include="NSubstitute" Version="4.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NSubstitute --version 4.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NSubstitute, 4.3.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. 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=4.3.0

// Install NSubstitute as a Cake Tool
#tool nuget:?package=NSubstitute&version=4.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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 Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard1.3 netstandard1.4 netstandard1.5 netstandard1.6 netstandard2.0 netstandard2.1
.NET Framework net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen30 tizen40 tizen60
Universal Windows Platform uap uap10.0
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (146)

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.

AutofacContrib.NSubstitute

Package Description

MockQueryable.NSubstitute

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.

Sitecore.FakeDb.NSubstitute

Unit testing framework for Sitecore.

NSubstituteAutoMocker

AutoMocker for use with NSubstitute

GitHub repositories (224)

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

Repository Stars
dotnet/maui
.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
aspnetboilerplate/aspnetboilerplate
ASP.NET Boilerplate - Web Application Framework
bitwarden/server
The core infrastructure backend (API, database, Docker, etc).
dotnet/orleans
Cloud Native application framework for .NET
abpframework/abp
Open Source Web Application Framework for ASP.NET Core
Version Downloads Last updated
4.3.0 1,293,033 1/24/2022
4.2.2 13,904,160 6/13/2020
4.2.1 10,095,463 7/15/2019
4.2.0 1,784,887 5/19/2019
4.1.0 567,730 5/5/2019
4.0.0 2,749,175 1/30/2019
4.0.0-rc1 82,798 11/19/2018
3.1.0 9,671,250 10/27/2017
3.0.1 429,468 10/8/2017
2.0.3 4,679,438 4/25/2017
2.0.1-rc 149,493 12/17/2016
2.0.0-rc 162,076 8/7/2016
1.10.0 2,972,358 3/22/2016
1.9.2 1,096,283 10/22/2015
1.9.1 355,540 9/30/2015
1.8.2 876,014 5/29/2015
1.8.1 629,964 12/26/2014
1.8.0 112,506 11/11/2014
1.7.2 481,887 3/4/2014
1.7.1 206,885 1/16/2014
1.7.0 37,614 1/3/2014
1.6.1 241,268 6/30/2013
1.6.0 88,009 4/19/2013
1.5.0 273,898 1/25/2013
1.4.3 61,190 8/15/2012
1.4.2 24,536 7/1/2012
1.4.1 3,063 6/28/2012
1.4.0 22,776 5/4/2012
1.3.0 40,063 11/22/2011
1.2.1 5,908 10/10/2011
1.2.0 3,684 9/29/2011
1.1.0 34,033 5/21/2011
1.0.0 40,059 5/17/2011
0.9.5 3,807 1/7/2011
0.9.0.34 18,904 1/7/2011