Skip to content

Add unit tests for TrxTestDefinitionName behavior in TrxReportEngine#7598

Merged
Youssef1313 merged 2 commits intodev/ygerges/trx-displayfrom
copilot/sub-pr-7595
Mar 24, 2026
Merged

Add unit tests for TrxTestDefinitionName behavior in TrxReportEngine#7598
Youssef1313 merged 2 commits intodev/ygerges/trx-displayfrom
copilot/sub-pr-7595

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

Addresses missing test coverage for the TrxTestDefinitionName property logic introduced to align UnitTest/@name in TRX files with test case display names rather than test result display names.

Tests added

  • Explicit name used for UnitTest/@name: When TrxTestDefinitionName is present, UnitTest/@name uses it while UnitTestResult/@testName continues to use the node's display name.

  • Duplicate id / conflicting explicit names throws: Two results sharing the same test id but carrying different explicit TrxTestDefinitionName values → InvalidOperationException.

  • Ordering: fallback-first then matching explicit succeeds: First result has no TrxTestDefinitionName (falls back to display name); second result provides an explicit TrxTestDefinitionName equal to that fallback → no exception, dictionary updated to mark the entry as explicitly provided.

// First result: fallback name "MethodName"
CreateTestNodeUpdate("same-uid", "MethodName", new PropertyBag(new PassedTestNodeStateProperty()))
// Second result: explicit TrxTestDefinitionName "MethodName" — matches fallback, succeeds
CreateTestNodeUpdate("same-uid", "MethodName", new PropertyBag(new PassedTestNodeStateProperty(), new TrxTestDefinitionName("MethodName")))

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] [WIP] Address feedback on test definition name alignment in TRX files Add unit tests for TrxTestDefinitionName behavior in TrxReportEngine Mar 24, 2026
Copilot AI requested a review from Youssef1313 March 24, 2026 11:41
@Youssef1313 Youssef1313 marked this pull request as ready for review March 24, 2026 18:06
@Youssef1313 Youssef1313 merged commit 691118b into dev/ygerges/trx-display Mar 24, 2026
11 checks passed
@Youssef1313 Youssef1313 deleted the copilot/sub-pr-7595 branch March 24, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants