Conversation
There was a problem hiding this comment.
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(
This was referenced Jul 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2481