From 01870861160edc2dad3660a78fe96a6908534c49 Mon Sep 17 00:00:00 2001 From: Max Claude Date: Fri, 13 Nov 2026 12:00:13 +0100 Subject: [PATCH] Move the test project from xUnit v2 to xUnit v3 xunit 2.9.3 and its four sub-packages are deprecated on nuget.org (Legacy, successor xunit.v3) and only get security fixes. - Replace xunit 2.9.3 with xunit.v3.mtp-off 4.0.3, the VSTest variant of the xunit3 template: dotnet test, CI and Test Explorer keep working unchanged. Plain xunit.v3 brings Microsoft Testing Platform v2, and dotnet test on the .NET 10 SDK then fails in VSTest mode unless a global.json opts into MTP. - Set OutputType Exe: v3 runs the tests in their own process, started from the app host EvenBetterFastSim.Tests.exe. - Bump Microsoft.NET.Test.Sdk 18.10.0 -> 18.12.0 and xunit.runner.visualstudio 4.0.0 -> 4.0.1 (the template pairing). - CLAUDE.md, AGENTS.md: say xUnit v3 and why mtp-off. The test code needs no change. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- CLAUDE.md | 2 +- .../EvenBetterFastSim.Tests.csproj | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index c3d0f86..ce39b43 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,7 +11,7 @@ dotnet run --project EvenBetterFastSim/EvenBetterFastSim.csproj Configurations: `Debug` and `Release` (use the `SecsGemBase.MessageHandling` / `SecsGemBase.ScenarioEngine` pre-release NuGet packages from nuget.org), `DebugLocal` (uses SecsGemBase DLLs from `%USERPROFILE%\source\repos\SecsGemBase\`). -No linter, no typecheck. Tests: `EvenBetterFastSim.Tests` (xUnit) — build the app first, then test: +No linter, no typecheck. Tests: `EvenBetterFastSim.Tests` (xUnit v3 via VSTest, package `xunit.v3.mtp-off`) — build the app first, then test: ```bash dotnet build EvenBetterFastSim.sln -c DebugLocal diff --git a/CLAUDE.md b/CLAUDE.md index 601da23..6db3860 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,7 +15,7 @@ When modifying SecsGemBase, publish the updated `SecsGemBase.*` packages to nuge ### Tests -`EvenBetterFastSim.Tests` is an xUnit project covering the SecsGemItem binary-save flow. It validates the **shipping build**, so it references the DLLs from the app's `Release` output (public SecsGemBase NuGet packages, not `DebugLocal`). Build the app in Release first, as its own `dotnet` invocation — the test project's reference glob is expanded at evaluation time and needs the app output to already exist: +`EvenBetterFastSim.Tests` is an xUnit v3 project covering the SecsGemItem binary-save flow. It is an executable: v3 runs the tests in their own process, started from `EvenBetterFastSim.Tests.exe`. It uses `xunit.v3.mtp-off`, so `dotnet test` stays on VSTest; plain `xunit.v3` would bring Microsoft Testing Platform v2, and `dotnet test` on the .NET 10 SDK then fails unless a `global.json` opts into MTP. It validates the **shipping build**, so it references the DLLs from the app's `Release` output (public SecsGemBase NuGet packages, not `DebugLocal`). Build the app in Release first, as its own `dotnet` invocation — the test project's reference glob is expanded at evaluation time and needs the app output to already exist: ```bash dotnet build EvenBetterFastSim/EvenBetterFastSim.csproj -c Release diff --git a/EvenBetterFastSim.Tests/EvenBetterFastSim.Tests.csproj b/EvenBetterFastSim.Tests/EvenBetterFastSim.Tests.csproj index 85666f5..86ebed3 100644 --- a/EvenBetterFastSim.Tests/EvenBetterFastSim.Tests.csproj +++ b/EvenBetterFastSim.Tests/EvenBetterFastSim.Tests.csproj @@ -2,6 +2,7 @@ net10.0-windows + Exe true enable preview @@ -26,10 +27,18 @@ $(MSBuildProjectDirectory)\..\EvenBetterFastSim\bin\Release\net10.0-windows7.0 + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive