[tests] Upgrade tests/monotouch-test to NUnit v4 Assert.That syntax#25456
Conversation
Convert classic NUnit assertions to NUnit v4's constraint-based Assert.That syntax across the monotouch-test project. Also improve test failure diagnostics by: - Swapping literal/actual argument order in Assert.That calls so that on failure NUnit reports 'Expected: <literal> But was: <actual>' instead of the confusing reverse - Splitting compound boolean assertions (e.g. nalCount == 4 && paramCount == 2) into individual constraint-based assertions that report each value independently on failure - Converting Assert.That(x == y, Is.True) non-operator value checks to proper Assert.That(x, Is.EqualTo(y)) form Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #9b026d1] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #9b026d1] Build passed (Build packages) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [PR Build #9b026d1] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #9b026d1] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 183 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Convert classic NUnit assertions to NUnit v4's constraint-based
Assert.That syntax across the monotouch-test project.
Also improve test failure diagnostics by:
Swapping literal/actual argument order in Assert.That calls so that
on failure NUnit reports 'Expected: But was: '
instead of the confusing reverse
Splitting compound boolean assertions (e.g. nalCount == 4 &&
paramCount == 2) into individual constraint-based assertions that
report each value independently on failure
Converting Assert.That(x == y, Is.True) non-operator value checks
to proper Assert.That(x, Is.EqualTo(y)) form