Skip to content

Conversation

@thomhurst
Copy link
Owner

Fixes #2481

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for storing multiple property values under the same key by changing the type of custom properties from single string values to collections of strings. Key changes include updating test methods, modifying public API signatures, and revising property extraction and addition logic throughout the codebase.

  • Updated CustomProperties type in test and core code from string to IReadOnlyList.
  • Improved property extraction and addition logic in TestExtensions and DiscoveredTestContext.
  • Added new tests to verify the multi-value property behavior.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
TUnit.TestProject/CustomPropertyTests.cs Updated GetDictionary() to use a list for property values.
TUnit.TestProject/Bugs/2481/Tests.cs Added tests verifying multiple values per property key.
TUnit.PublicAPI/*.verified.txt Updated CustomProperties type in API definitions.
TUnit.Engine/Services/TestFilterService.cs Revised property bag construction to aggregate list results.
TUnit.Engine/Json/TestJson.cs Changed property type for custom properties.
TUnit.Engine/Extensions/TestExtensions.cs Introduced ExtractProperties to yield key-value pair properties.
TUnit.Engine.Tests/Bugs/Bug2481.cs Added bug reproduction tests for multiple property values.
TUnit.Core/TestDetails.cs Changed InternalCustomProperties to a concurrent dictionary and updated the getter.
TUnit.Core/DiscoveredTestContext.cs Modified AddProperty to accumulate values in a list.
Comments suppressed due to low confidence (1)

TUnit.Core/TestDetails.cs:119

  • The CustomProperties getter references an undeclared 'field' for lazy initialization, which could lead to runtime errors. Consider defining and using a proper backing field or converting this to an auto-property with an initializer.
public IReadOnlyDictionary<string, IReadOnlyList<string>> CustomProperties => field ??= InternalCustomProperties.ToDictionary(

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUnit Limitation Regarding Duplicate PropertyAttribute Usage

2 participants