NSubstitute.Analyzers.VisualBasic

Provides diagnostic analyzers to warn about incorrect usage of NSubstitute in VB.NET.


Keywords
analyzers, nsubstitute, nsubstitute.analyzers, roslyn, vb, vb.net, visualbasic, csharp, dotnet, roslyn-analyzer
License
MIT
Install
Install-Package NSubstitute.Analyzers.VisualBasic -Version 1.0.17

Documentation

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

Branch Build Coverage
Master Build status Coverage Status
Dev Build status Coverage 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.