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

Update nunit.analyzers.nuspec to specify that NUnit.Analyzers v4 is intended to be used with NUnit 4. #761

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

andrewimcclement
Copy link
Contributor

No description provided.

@Bartleby2718
Copy link
Contributor

NUnit.Analyzers v4 can still be used to help folks transition from NUnit v3 to NUnit v4, so I'm not sure if I agree with this.

@andrewimcclement
Copy link
Contributor Author

It can, but it references classes like ClassicAssert which only exist in NUnit v4, so the messages are often incorrect, even if the majority of quick fixes will be fine.

@manfred-brands
Copy link
Member

The analyzer works with both NUnit 3 and 4. It detects which version if NUnit is referenced in your project and changes behaviour accordingly.

It has to be used with NUnit 3 to prepare moving to NUnit 4 as the latter has breaking changes, especially regarding message formatting.

@andrewimcclement
Copy link
Contributor Author

By all means suggest an alternative phrasing - I feel v4 is at least more accurate than v3, but we may be able to do better.

@andrewimcclement
Copy link
Contributor Author

We could just say 3+ instead of 3? Or maybe it is worth being explicit - for use with v4 or for the purposes of migrating from v3 to v4 or something?

@manfred-brands
Copy link
Member

3+ is fine. Also mentioning the migration is good.

Where do you say it references ClassicAssert when using with v3?
If you mean the Assert.AreEqual, those conversion analyzers existed way before there was a ClassicAssert class.

The {v4 migration guide](https://docs.nunit.org/articles/nunit/release-notes/Nunit4.0-MigrationGuide.html#convert-classic-assert-to-constraint-model) says:

Caveat: The analyzers only run when the code compiles, so execute and act on the analyzer before upgrading nunit to version 4.0.0!

@andrewimcclement
Copy link
Contributor Author

Oh sure, the analyzers existed, it's just they give an incorrect message (precisely because the message talks about the ClassicAssert class, which doesn't exist in v3). It's just a small peeve.

Copy link
Member

@manfred-brands manfred-brands left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with these changes

@manfred-brands manfred-brands merged commit 8e5a34b into nunit:master Jun 13, 2024
6 checks passed
@andrewimcclement andrewimcclement deleted the aim/description_nunit_4 branch June 14, 2024 14:20
@mikkelbu mikkelbu added this to the Release 4.3 milestone Jun 27, 2024
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 this pull request may close these issues.

4 participants