CheckId | NS5000 |
Category | Usage |
Checking received calls without specifying member.
A violation of this rule occurs when there is no call after
Received()
ReceivedWithAnyArgs()
DidNotReceived()
DidNotReceiveWithAnyArgs()
To fix a violation of this rule, call method or access member after received checks.
For example:
// Incorrect:
sub.Received();
// Correct:
sub.Received().SomeMethodCall();
This warning can be suppressed by disabling the warning in the ruleset file for the project. The warning can also be suppressed programmatically for an assembly:
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "NS5000:Received check.", Justification = "Reviewed")]
Or for a specific code block:
#pragma warning disable NS5000 // Received check.
// the code which produces warning
#pragma warning restore NS5000 // Received check.