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
307.1M
307,067,086
Published
Sep 11, 2023
Latest stable version

Install

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

Frameworks

.NETFramework4.6.2 net6.0 .NETStandard2.0

Dependencies

Castle.Core
.NETFramework4.6.2
[5.1.1, )
[4.3.0, )
[5.1.1, )
Castle.Core
.NETStandard2.0
[5.1.1, )
[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 3 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.