I am the developer of bUnit, a testing library for Blazor components.
One of my users are reporting that the custom assertion methods I provide are not recognized as assertion methods, and causes the following lint error to be reported: https://rules.sonarsource.com/csharp/RSPEC-2699
Is there a way for me as a library author to give SonarLint a hint to get around this false-positive?
Welcome to our community. The S2699 rule is mainly aware only of MSTest, NUnit and XUnit frameworks. It has no configuration nor customization capability, so it cannot be configured with SonarQube rule attributes nor by any kind of ThisIsAssertionMethodAttribute.
The detection of assertions is based on string comparation. If the method name contains any of these keywords (case insensitive), then it’s considered to be an assertion: