Skip to content

[tests] Upgrade tests/linker to NUnit v4 Assert.That syntax#25484

Merged
rolfbjarne merged 3 commits into
mainfrom
dev/rolf/nunitv4-linker
May 21, 2026
Merged

[tests] Upgrade tests/linker to NUnit v4 Assert.That syntax#25484
rolfbjarne merged 3 commits into
mainfrom
dev/rolf/nunitv4-linker

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

Convert classic NUnit assertions (Assert.AreEqual, Assert.IsNotNull,
Assert.IsTrue, etc.) to NUnit v4 constraint-based Assert.That syntax
across all linker test files.

Convert classic NUnit assertions (Assert.AreEqual, Assert.IsNotNull,
Assert.IsTrue, etc.) to NUnit v4 constraint-based Assert.That syntax
across all linker test files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the linker test suite to use NUnit v4’s constraint-based Assert.That syntax, aligning the tests with the newer NUnit assertion style used across the repo.

Changes:

  • Converted classic NUnit assertions (Assert.True/False/Null/NotNull/AreEqual/IsTrue/...) to Assert.That(..., Is/Does/Has...) across linker tests.
  • Updated a few Assert.Fail calls from composite formatting to interpolated strings while doing the conversion.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/linker/link sdk/TaskTest.cs Convert task continuation assertions to Assert.That.
tests/linker/link sdk/ReflectionTest.cs Update commented assertion to Assert.That syntax.
tests/linker/link sdk/PclTest.cs Convert classic assertions in PCL-related HTTP tests to constraints.
tests/linker/link sdk/OptimizeGeneratedCodeTest.cs Convert null/boolean assertions to constraints.
tests/linker/link sdk/LocaleTest.cs Convert Assert.True checks to Assert.That(..., Is.True).
tests/linker/link sdk/LinkSdkTest.cs Convert type-presence assertions to constraint-based null checks.
tests/linker/link sdk/LinkSdkRegressionTest.cs Broad conversion to Assert.That and a few Assert.Fail message updates.
tests/linker/link sdk/LinkExtraDefsTest.cs Convert type/method presence checks to Assert.That.
tests/linker/link sdk/HttpClientHandlerTest.cs Convert handler property assertions to constraints.
tests/linker/link sdk/DllImportTest.cs Convert P/Invoke return + wait assertions to constraints.
tests/linker/link sdk/CryptoTest.cs Convert crypto/network assertions to constraint-based syntax.
tests/linker/link sdk/BitcodeTest.cs Convert equality/boolean assertions and update Assert.Fail formatting.
tests/linker/link sdk/AotBugs.cs Convert LINQ/AOT regression assertions to constraints.
tests/linker/link all/StructLayoutTest.cs Convert layout boolean assertions to constraints.
tests/linker/link all/SerializationTest.cs Convert null/type preservation assertions to constraints.
tests/linker/link all/SealerTest.cs Convert sealing/virtual/final assertions to constraints.
tests/linker/link all/PreserveTest.cs Convert preservation checks to constraint assertions.
tests/linker/link all/LinqExpressionTest.cs Convert lambda creation assertion to Assert.That.
tests/linker/link all/LinkAllTest.cs Convert a large set of linker-behavior assertions to constraints.
tests/linker/link all/LinkAllMacTest.cs Convert UI-thread/serialization assertions to constraints.
tests/linker/link all/InternalsTest.cs Convert internal symbol assertions to constraints.
tests/linker/link all/InterfacesTest.cs Convert reflection-based interface/linker assertions to constraints.
tests/linker/link all/DataContractTest.cs Convert equality assertion to Assert.That.
tests/linker/link all/ClassLayoutTest.cs Convert layout boolean assertions to constraints.
tests/linker/link all/AttributeTest.cs Convert attribute-presence assertions to constraints.
tests/linker/dont link/DontLinkRegressionTests.cs Convert assertions and update one Assert.Fail formatting string.
tests/linker/CommonLinkAnyTest.cs Convert common linker assertions to Assert.That.
tests/linker/CommonLinkAllTest.cs Convert type converter/version assertions to constraints.
tests/linker/BaseOptimizeGeneratedCodeTest.cs Convert counter/IL-count/value assertions to constraints.
tests/linker/AppDelegate.cs Convert test assembly count assertion to Assert.That.

Comment thread tests/linker/link sdk/LinkSdkRegressionTest.cs Outdated
Comment thread tests/linker/link all/LinkAllTest.cs Outdated
Comment thread tests/linker/CommonLinkAnyTest.cs
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 2 commits May 21, 2026 07:17
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@rolfbjarne rolfbjarne marked this pull request as ready for review May 21, 2026 05:18
@rolfbjarne rolfbjarne enabled auto-merge (squash) May 21, 2026 05:18
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #0704825] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 07048250ae92b646d172b586b4fe52dabd2a8fbc [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #0704825] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 07048250ae92b646d172b586b4fe52dabd2a8fbc [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 07048250ae92b646d172b586b4fe52dabd2a8fbc [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #0704825] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 07048250ae92b646d172b586b4fe52dabd2a8fbc [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🔥 [CI Build #0704825] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

1 tests crashed, 13 tests failed, 150 tests passed.

Failures

❌ fsharp tests

2 tests failed, 2 tests passed.

Failed tests

  • fsharp/iOS - simulator/Debug: LaunchTimedOut
  • fsharp/tvOS - simulator/Debug: LaunchTimedOut

Html Report (VSDrops) Download

❌ linker tests (iOS)

11 tests failed, 0 tests passed.

Failed tests

  • dont link/iOS - simulator/Debug: LaunchTimedOut
  • dont link/iOS - simulator/Release: LaunchTimedOut
  • link sdk/iOS - simulator/Debug: LaunchTimedOut
  • link sdk/iOS - simulator/Release: LaunchTimedOut
  • link all/iOS - simulator/Debug: LaunchTimedOut
  • link all/iOS - simulator/Release: LaunchTimedOut
  • link all/iOS - simulator/Debug (don't bundle original resources): LaunchTimedOut
  • trimmode copy/iOS - simulator/Debug: LaunchTimedOut
  • trimmode copy/iOS - simulator/Release: LaunchTimedOut
  • trimmode link/iOS - simulator/Debug: LaunchTimedOut
  • trimmode link/iOS - simulator/Release: LaunchTimedOut

Html Report (VSDrops) Download

❌ monotouch tests (MacCatalyst)

🔥 Failed catastrophically on VSTS: test results - monotouch_maccatalyst (no summary found).

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. (⚠️ Html Report Publish failed ⚠️) Download
✅ dotnettests (tvOS): All 1 tests passed. (⚠️ Html Report Publish failed ⚠️) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. (⚠️ Html Report Publish failed ⚠️) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 11 tests passed. (⚠️ Html Report Publish failed ⚠️) Download
✅ linker (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. (⚠️ Html Report Publish failed ⚠️) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. (⚠️ Html Report Publish failed ⚠️) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 07048250ae92b646d172b586b4fe52dabd2a8fbc [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🔥 Failed to compute test summaries on VSTS: test results 🔥

Failed to compute test summaries:

Unicorn! &middot; GitHub

  body {
    background-color: #f1f1f1;
    margin: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  }

  .container { margin: 50px auto 40px auto; width: 600px; text-align: center; }

  a { color: #4183c4; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { letter-spacing: -1px; line-height: 60px; font-size: 60px; font-weight: 100; margin: 0px; text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 10px 0 10px; font-size: 18px; font-weight: 200; line-height: 1.6em;}

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and (     -o-min-device-pixel-ratio: 2/1),
  only screen and (        min-device-pixel-ratio: 2),
  only screen and (                min-resolution: 192dpi),
  only screen and (                min-resolution: 2dppx) {
    .logo-img-1x { display: none; }
    .logo-img-2x { display: inline-block; }
  }

  #suggestions {
    margin-top: 35px;
    color: #ccc;
  }
  #suggestions a {
    color: #666666;
    font-weight: 200;
    font-size: 14px;
    margin: 0 10px;
  }






  
    
  

  We had issues producing the response to your request.
  Sorry about that. Please try refreshing and contact us if the problem persists.
  
    Contact Support &mdash;
    GitHub Status &mdash;
    @githubstatus

.

Pipeline on Agent
Merge 0704825 into e6b123e

@rolfbjarne rolfbjarne merged commit 8cf6be2 into main May 21, 2026
48 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants