-
Notifications
You must be signed in to change notification settings - Fork 32
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
Create ValuesUsageAnalyzer. #570
Create ValuesUsageAnalyzer. #570
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. It is a good start.
Please add the documentation .md file so the tests can pass.
If you run the test locally you get a skeleton file you can rename and update.
I'm not sure how much code is sharable between the two analyzers, except for the tests to see if a parameter can be assigned from the supplied value.
The analyzers are different that one has multiple values for one parameter, the other a single value for each parameter.
@manfred-brands I used NUnit2048 as it was simply the next number in the list without skipping to the 3000s, but should this be in the 1000s? I'm not really sure of the overall scheme. |
Now using NUnit1031 for consistency with other structural issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small suggested changes to documentation.
src/nunit.analyzers.tests/ValuesUsage/ValuesUsageAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
… not yet do anything but basic structure is in place.
…nalyzer. Add functioning test cases.
…ject?[] for the wrong type for [Values(null)] - can we do better?
…ot improving an assertion.
Moved AdjustArguments to re-usable extension method. Added GetAdjustedArgumentSyntax to get proper argument from explicit array parameters Added unit tests for explicit array parameters Added unit tests for nullable
Added unit tests for explicit array parameters Added unit tests for nullable
@mikkelbu As I also made changes, I would appreciate your review when you have time. |
@manfred-brands I'll take a look at it now. And thank you both for all the work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. I only found a couple of nitpicks.
src/nunit.analyzers/Extensions/AttributeArgumentTypedConstantExtensions.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Mikkel Nylander Bundgaard <mikkelbu@users.noreply.github.com>
Aiming to resolve #52 , though I haven't actually shared any code at this point. Refactoring suggestions are very welcome.
All tests are duplicated from TestCaseUsageAnalyzerTests.
AnalyzeWhenArgumentPassesNullToValueType
demonstrates[Values(null)]
reporting a slightly unhelpful type to the user - fixes/suggestions are welcome.