Skip to content

TUnit Limitation Regarding Duplicate PropertyAttribute Usage #2481

@samtrion

Description

@samtrion

While migrating from xUnit v2 to TUnit, I encountered a limitation related to the usage of PropertyAttribute. Specifically, TUnit does not currently support applying multiple PropertyAttribute instances with the same key to a single test method or class.

In my case, this becomes relevant when using a custom extension like [TestGroupAttribute], which builds on top of PropertyAttribute to assign tests to multiple logical groups. Under xUnit [TestGroupAttribute] xUnit Version, this approach allowed me to associate several group values under the same key without issue.

I use this mechanism in my healthchecks repository to organize and filter tests across different assemblies and services. Assigning multiple TestGroupAttribute values with the same key allows me to group tests by services or other context elements. With TUnit's current behavior, this grouping strategy is no longer supported.

I understand this might be by design or due to technical constraints, and I’d be happy to provide further context or contribute to a potential solution if this is something the maintainers are open to discussing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions