Skip to main content
NSubstitute package icon

NSubstitute

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.

Total Downloads
292.4M
292,438,435
Published
Jul 15, 2019
Latest stable version

Install

.NET CLI
dotnet add package NSubstitute --version 4.2.1
Package Manager Console
Install-Package NSubstitute -Version 4.2.1
PackageReference
<PackageReference Include="NSubstitute" Version="4.2.1" />

Frameworks

.NETFramework4.5 .NETFramework4.6 .NETStandard1.3 .NETStandard2.0

Dependencies

Castle.Core
.NETFramework4.5
[4.4.0, )
[4.3.0, )
Castle.Core
.NETFramework4.6
[4.4.0, )
[4.3.0, )
Castle.Core
.NETStandard1.3
[4.4.0, )
NETStandard.Library
.NETStandard1.3
[1.6.1, )
System.Linq.Queryable
.NETStandard1.3
[4.3.0, )
[4.3.0, )
[4.3.0, )
Castle.Core
.NETStandard2.0
[4.4.0, )
[4.3.0, )

Adoption guide

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 4 target frameworks; confirm the exact target used by your application.

How to read this guidance

Sources: published NuGet v3 registry metadata and explicit NuBrowse editorial guides. Refresh: package metadata is refreshed from NuGet when the page loads. Limit: this is not a security, legal or compatibility guarantee; validate the selected version in your project.

Useful next steps

Move from package metadata to a concrete selection or review workflow.