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

New rule S2970: Assertions should be complete #6662

Closed
gregory-paidis-sonarsource opened this issue Jan 23, 2023 · 2 comments · Fixed by #6757
Closed

New rule S2970: Assertions should be complete #6662

gregory-paidis-sonarsource opened this issue Jan 23, 2023 · 2 comments · Fixed by #6757
Assignees
Labels
Area: C# C# rules related issues.
Milestone

Comments

@gregory-paidis-sonarsource
Copy link
Contributor

gregory-paidis-sonarsource commented Jan 23, 2023

S2970
RSpec change: SonarSource/rspec#1518

Related rule S2699 implemented in TestMethodShouldContainAssertion

Methods/Props without "continuation" that should be detected:

Unaffected libraries:

  • NUnit
  • xUnit
  • Shoudly

Existing rules in the testing libs:

@gregory-paidis-sonarsource
Copy link
Contributor Author

This rule could be implemented as an additional diagnostic inside of S2699.
This will improve the precision of the rule's raised diagnostic, while also being faster than implementing similar logic twice, at least up until a point.

@martin-strecker-sonarsource
Copy link
Contributor

MSTest was removed because Assert.That is a property and can not be used as a standalone statement.

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants