/ sonar-dotnet Public
Fix S2699 FP: AssertionMethodAttribute is ignored when assertion method is inherited #6525
C# rules related issues.
Short-lived label (that will live long due to reusability)
Type: False Positive
Rule IS triggered when it shouldn't be.
When writing a test without an explicit assertion but using a method to perform that assertion, S2699 is raised if the method is from a parent class.
SonarLint doesn't seem to report the issue, it is reported only when scanned on the pipeline with SonarScanner
Reports a S2699:
This doesn't report S2699 :
When assertion method is inherited, it should be detected as an assertion method.
When assertion methid is inherited, Sonar reports that the test has no assertion
Override the parent method and set the assertion attribute on that one, and inside call the parent
The text was updated successfully, but these errors were encountered: