Skip to content

Exclude TUnit CancellationToken parameters from snapshot naming - #1940

Merged
SimonCropp merged 1 commit into
mainfrom
tunit-cancellation-token-params
Sep 24, 2026
Merged

SimonCropp merged 1 commit into
mainfrom
tunit-cancellation-token-params

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

Fixes #1939

TUnit injects CancellationToken parameters itself, so they are absent from TestMethodArguments but were present in GetParameterNames(). The argument/parameter count guard added in #1894 then failed, and arguments were silently dropped from snapshot names.

GetParameterNames now skips CancellationToken parameters, restoring the 32.0.0 naming (WithCancellationToken_value=a). The exact-count guard is kept, so the params protection is unchanged.

Adds CancellationTokenTests covering two [Arguments] rows with a CancellationToken parameter.

@SimonCropp SimonCropp added this to the 33.1.4 milestone Sep 24, 2026
@SimonCropp
SimonCropp merged commit 9a60ea6 into main Sep 24, 2026
6 checks passed
@SimonCropp
SimonCropp deleted the tunit-cancellation-token-params branch September 24, 2026 09:59
This was referenced Sep 24, 2026
This was referenced Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[TUnit] v33: test arguments dropped from snapshot name when the test method has a CancellationToken parameter

1 participant