Skip to content

Misleading error message when class used in IClassFixture<> throws exception in constructor #2927

@thomhurst

Description

@thomhurst

Steps:

  • Create a class that throws an exception in its constructor
  • Use that class in an IClassFixture<>
  • Run tests in the test class that defines the IClassFixture<>

Reproduction is here: https://github.com/thomhurst/xUnitFixtureDataErrorMessageReproduction

The error message implies that the data setup for the test is wrong, when in reality an exception was thrown.

Xunit.Sdk.TestClassException
The following constructor parameters did not have matching fixture data: MyData myData

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA fault in an existing featureCore frameworkxunit.v3.core

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions