diff --git a/plugins/dotnet-test/skills/migrate-xunit-to-mstest/SKILL.md b/plugins/dotnet-test/skills/migrate-xunit-to-mstest/SKILL.md index fba4013c4..f0c8c0eb3 100644 --- a/plugins/dotnet-test/skills/migrate-xunit-to-mstest/SKILL.md +++ b/plugins/dotnet-test/skills/migrate-xunit-to-mstest/SKILL.md @@ -342,7 +342,7 @@ public TestContext TestContext { get; set; } = null!; - `TestContext.Current.AddAttachment(name, path)` -> `_testContext.AddResultFile(path)` - `TestContext.Current.TestOutputHelper.WriteLine(...)` -> `_testContext.WriteLine(...)` -> **REQUIRED for CancellationToken:** Add the constructor injection from above even if the class only uses `TestContext.Current.CancellationToken` (no `ITestOutputHelper`). Do **NOT** replace `TestContext.Current.CancellationToken` with a new `CancellationTokenSource` -- that loses the test-host's cancellation linkage and changes behavior under timeouts. +> **REQUIRED for CancellationToken:** Add the constructor injection from above (or property injection if pinned to MSTest < 3.6) even if the class only uses `TestContext.Current.CancellationToken` (no `ITestOutputHelper`). Do **NOT** replace `TestContext.Current.CancellationToken` with `CancellationToken.None` or a freshly-constructed `CancellationTokenSource` -- both lose the test-host's cancellation linkage and change behavior under timeouts. ```csharp // xUnit v3