Skip to content

Generic class/method pairing regression test can miss duplicate combinations #7529

Closed

Description

@thomhurst

The generic class/method inference regression fixture checks four passing rows, but it does not prove that all four distinct constructor/method argument combinations ran. A missing combination replaced by a duplicate could therefore pass this regression test.

Reproduction

At PR #7498, commit e8f5b47:

  • tests/TUnit.TestProject/Bugs/_7451/ClassAndMethodParameterInferenceTests.cs accepts either constructor value (first, second) and either method value (3, 4) independently.
  • tests/TUnit.Engine.Tests/GenericMethodInferencePolicyTests.cs verifies total/pass/failure counts for that fixture, without comparing result identities.

Replacing one valid combination with a duplicate of another would preserve these assertions. This is a test coverage gap; no production pairing defect was observed. CodeRabbit identified it as a non-blocking suggestion in #7498.

Expected and actual

Expected: the regression test proves that (first,3), (first,4), (second,3) and (second,4) each execute once in both discovery modes.
Actual: four individually valid results satisfy the current assertions even if a pair repeats.

Please strengthen this fixture or its result assertions to verify the four distinct pairs in both modes, using stable result identity or an equivalent assertion that supports concurrent execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: cleanup, minor enhancement, or rare edge caseenhancementNew feature or requestin-progressWork is in progress

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions