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

NUnit: migrate to constraints model #345

Merged
merged 6 commits into from
Mar 8, 2025

Conversation

metoule
Copy link
Contributor

@metoule metoule commented Feb 9, 2025

Starting with NUnit 4, the "classic" model of assertions is no longer available. This PR updates the test dependencies to the latest versions, including NUnit, and use the new constraint model.

This means that instead of writing:

Assert.AreEqual(23, target.Eval("myVar"));

we must write

Assert.That(target.Eval("myVar"), Is.EqualTo(23));

Note that the goal is to have up-to-date dependencies, but we can stay on the 3.x version if you don't like the constraint model :)

@metoule metoule marked this pull request as ready for review February 9, 2025 20:00
@metoule metoule requested a review from davideicardi as a code owner February 9, 2025 20:00
Copy link
Member

@davideicardi davideicardi left a comment

Choose a reason for hiding this comment

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

Thank you!

I admin that the new syntax looks a little bit "unusual" for me, but using legacy code/syntax is never a good idea. LGTM!

@metoule metoule merged commit 0a34264 into dynamicexpresso:master Mar 8, 2025
2 checks passed
@metoule metoule deleted the nunit_update branch March 8, 2025 08:35
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.

2 participants