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. Type: New Feature This hasn't been here before.
Projects
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 gregory-paidis-sonarsource added Type: New Feature This hasn't been here before. Area: C# C# rules related issues. labels Jan 23, 2023
@gregory-paidis-sonarsource gregory-paidis-sonarsource added this to the 8.52 milestone Jan 23, 2023
@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.

@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Feb 22, 2023
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Feb 23, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Feb 23, 2023
@github-actions github-actions bot moved this from Review in progress to Review approved in Best Kanban Feb 24, 2023
Best Kanban automation moved this from Review approved to Validate Peach Feb 27, 2023
@martin-strecker-sonarsource martin-strecker-sonarsource moved this from Validate Peach to Done in Best Kanban Mar 1, 2023
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. Type: New Feature This hasn't been here before.
Projects
Best Kanban
  
Done
Development

Successfully merging a pull request may close this issue.

6 participants