README.md

October 22, 2018 ยท View on GitHub

Analyzers to detect possible NSubstitute usage problems, such as attempts to setup non-virtual members.

BranchBuildCoverage
MasterBuild statusCoverage Status
DevBuild statusCoverage Status

Install via NuGet

Motivation

NSubstitute was designed with the aim of having concise, friendly syntax for mocking. The downside of this syntax is that certain failure modes are hard to detect. One example is attempting to mock non-virtual members -- NSubstitute can not see these calls so can not communicate problems such as sub.Received().NonVirtualCall(). Thanks to the goodness of Roslyn analyzers, we now have the option to detect cases like these (as originally proposed in NSubstitute issue #328).

Documentation

For documentation and reasoning on the rules themselves, see the Documentation.

Support

Please report any problems or ask questions via the Issue tracker.