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 diagnostic: The Values attribute can be simplified. #755

Closed
Bartleby2718 opened this issue Jun 7, 2024 · 3 comments · Fixed by #758
Closed

New diagnostic: The Values attribute can be simplified. #755

Bartleby2718 opened this issue Jun 7, 2024 · 3 comments · Fixed by #758
Assignees
Milestone

Comments

@Bartleby2718
Copy link
Contributor

As mentioned in https://docs.nunit.org/articles/nunit/writing-tests/attributes/values.html#values-with-enum-or-boolean

[Test]
public void MyBoolTest([Values(true, false)] bool value) { /* ... */ } 

can be simplified to

[Test]
public void MyBoolTest([Values] bool value) { /* ... */ } 

We could add a new diagnostic to detect and simplify this.

The same goes for nullable boolean and enums.

@Bartleby2718
Copy link
Contributor Author

I can take a stab at this, so please assign this to me!

@manfred-brands
Copy link
Member

I can take a stab at this, so please assign this to me!

Done. Go ahead.

Bartleby2718 added a commit to Bartleby2718/nunit.analyzers that referenced this issue Jun 9, 2024
Bartleby2718 added a commit to Bartleby2718/nunit.analyzers that referenced this issue Jun 9, 2024
Bartleby2718 added a commit to Bartleby2718/nunit.analyzers that referenced this issue Jun 9, 2024
Bartleby2718 added a commit to Bartleby2718/nunit.analyzers that referenced this issue Jun 9, 2024
Bartleby2718 added a commit to Bartleby2718/nunit.analyzers that referenced this issue Jun 9, 2024
Bartleby2718 added a commit to Bartleby2718/nunit.analyzers that referenced this issue Jun 9, 2024
Bartleby2718 added a commit to Bartleby2718/nunit.analyzers that referenced this issue Jun 22, 2024
@mikkelbu mikkelbu added this to the Release 4.3 milestone Jun 27, 2024
@mikkelbu
Copy link
Member

Fixed by #758

@mikkelbu mikkelbu linked a pull request Jun 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants