Allow DisplayNameAttribute on classes with parameter substitution support#2705
Allow DisplayNameAttribute on classes with parameter substitution support#2705
Conversation
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
…prove documentation Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
c1b08a0 to
59052c2
Compare
|
Claude finished @Copilot's task —— View job PR Review Complete ✅I've completed a thorough review of this PR that adds class-level support to Todo List
Code Quality Assessment✅ Excellent Implementation QualityThe implementation in
✅ Robust DocumentationThe XML documentation is comprehensive with:
Potential Issues Found
|
This PR extends the
DisplayNameAttributeto support class-level usage, enabling custom display names for test classes with parameter substitution capabilities.Changes Made
Enhanced AttributeTargets
DisplayNameAttributefromAttributeTargets.MethodtoAttributeTargets.Method | AttributeTargets.ClassImproved Parameter Substitution
FormatDisplayNamemethod to handle class constructor parametersUpdated Documentation
Usage Examples
Class-level DisplayName without parameters:
Class-level DisplayName with parameter substitution:
Method-level DisplayName (existing functionality preserved):
Technical Details
Compatibility
This enhancement addresses the common scenario where developers want to provide meaningful names for test class scenarios, particularly useful for integration testing where each class represents a specific test scenario.
Fixes #2689.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.