Skip to content
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: Support Moq #7961

Closed
bdovaz opened this issue Sep 5, 2023 · 1 comment · Fixed by #9519
Closed

Fix S2699 FP: Support Moq #7961

bdovaz opened this issue Sep 5, 2023 · 1 comment · Fixed by #9519
Assignees
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Sprint: Hardening Fix FPs/FNs/improvements Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@bdovaz
Copy link

bdovaz commented Sep 5, 2023

S2699

Description

The following rule supports several frameworks but Moq is not among them:

https://rules.sonarsource.com/csharp/RSPEC-2699/

As you can see in the examples, it allows to verify for example that a method or event call is made:

https://github.com/moq/moq

But not being an Assert throws this rule as a false positive and forces to do ugly things like Assert.True(true).

Repro steps

Create a minimal example of Moq by taking it from the Readme.md file in repository and see how it throws the false positive of the mentioned rule.

@Tim-Pohlmann
Copy link
Contributor

Hi @bdovaz, thanks for bringing this to our attention.

@Tim-Pohlmann Tim-Pohlmann changed the title Rule 2699: False positive, should support Moq Fix S2699 FP: Support Moq Sep 6, 2023
@Tim-Pohlmann Tim-Pohlmann added Type: False Positive Rule IS triggered when it shouldn't be. Area: VB.NET VB.NET rules related issues. Area: C# C# rules related issues. labels Sep 6, 2023
@sebastien-marichal sebastien-marichal added the Sprint: Hardening Fix FPs/FNs/improvements label Jul 10, 2024
@sebastien-marichal sebastien-marichal self-assigned this Jul 10, 2024
@sebastien-marichal sebastien-marichal added this to the 9.29 milestone Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Sprint: Hardening Fix FPs/FNs/improvements Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants