New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix S2699 FP: AssertionMethodAttribute is ignored when assertion method is inherited #6525
Comments
Thank you for reporting this. |
I may have simplified the case too much. Indeed, in my "real" case, the parent class is in another assembly. |
Peach validation: No new issues found |
Description
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
Repro steps
Reports a S2699:
This doesn't report S2699 :
Expected behavior
When assertion method is inherited, it should be detected as an assertion method.
Actual behavior
When assertion methid is inherited, Sonar reports that the test has no assertion
Known workarounds
Override the parent method and set the assertion attribute on that one, and inside call the parent
Related information
The text was updated successfully, but these errors were encountered: