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

Migrate to nunit 4 #256

Merged
merged 2 commits into from
Dec 2, 2023
Merged

Migrate to nunit 4 #256

merged 2 commits into from
Dec 2, 2023

Conversation

dodexahedron
Copy link
Contributor

This includes the changes necessary to make the unit tests compile against NUnit 4.0.

I converted one set of tests to the Constraint style, as an example.

The rest I simply switched to the ClassicAssert class, which is the new location of all of the old assert methods.

No functional changes were made to any tests.

This supersedes #252 opened by Dependabot.
This also includes the changes from #255, which I opened a little while ago (this branch is branched from that commit).

@dodexahedron
Copy link
Contributor Author

I went ahead and converted a few more tests, just to demonstrate more concepts in the somewhat more complex test cases in BorderColorTests, over properties of collections and such. 🤷‍♂️

Update to NUnit 4 and fix assertions.

Just call through base class for new style

Converted the rest of the tests in AddViewTests.cs to new form

Shows a few recommended concepts for modern NUnit

Converted BorderColorTests to constraint style

Shows some more concepts
@tznind
Copy link
Collaborator

tznind commented Dec 2, 2023

Great stuff, I will try and port this to the v2 branch too (for supporting Terminal.Gui 2.0.0)

@tznind tznind merged commit 6258e77 into gui-cs:main Dec 2, 2023
@tznind
Copy link
Collaborator

tznind commented Dec 2, 2023

v2 now has latest dependency too 505305b

I didn't merge directly since test cases have diverted in updating Terminal.Gui 1 to 2 version compatibility so am missing some of the Assert..That goodness (see v2.x Breaking Change Thread). But I will start using that now in the v2 branch which is where I am focusing effort at the moment <3 .

@dodexahedron
Copy link
Contributor Author

Ah ok.

I just converted another test class in v1 on my same branch as was in the PR.

Don't bother with it, though. I'll branch from your v2 work and do future work in there instead. If the changes I made to that test class still apply in v2, I'll merge them over, but, if not, it was only like 15 minutes, so no biggie. :)

I had a feeling I probably should have focused on v2 from the start, but I didn't listen to myself, so my bad. 😅

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