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 to nunit 4 #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

jamespicone
Copy link
Contributor

Nunit has changed their assert interface in 4.0; their previous interface is now under some Nunit.Legacy namespace and uses the name ClassicAssert, and they've got a new one where you write Assert.That(thing, Is.EqualTo(blah)) etc.

This patch changes BaseTest to use the ClassicAssert interface and updates the project to depend on nunit4.

@bobbertoriley
Copy link
Contributor

bobbertoriley commented Oct 4, 2024

Suggestion: You can reduce the number of changes required to BaseTest by revering Assert -> ClassicAssert and then doing a one-line import. Reduces the diff while maintaining the functionality. It's how I handled the upgrade in my own project.

using Assert = NUnit.Framework.Legacy.ClassicAssert;

If we're going to make changes to the Assert.Foo() lines, it'd probably be better to move them over to NUnit 4 assertions.

@MigrantP
Copy link
Member

MigrantP commented Oct 4, 2024

Is there a pressing need to update to NUnit 4 here?

@jamespicone
Copy link
Contributor Author

I don't remember the motivation i'm afraid; I had a vague memory that it was an issue with nunit 3's support for more recent .net frameworks but i just checked and it seems fine against 4.8.

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.

3 participants