-
Notifications
You must be signed in to change notification settings - Fork 291
MSTEST0060: Add analyzer for duplicate test method attributes #7076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Evangelink
merged 8 commits into
main
from
copilot/add-duplicate-test-attribute-analyzer
Dec 12, 2025
Merged
MSTEST0060: Add analyzer for duplicate test method attributes #7076
Evangelink
merged 8 commits into
main
from
copilot/add-duplicate-test-attribute-analyzer
Dec 12, 2025
Conversation
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
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add analyzer for duplicate test method attribute
Add analyzer for duplicate test method attributes (MSTEST0059)
Dec 7, 2025
Evangelink
reviewed
Dec 7, 2025
Changed description from "unexpected behavior" to explicitly state that only the first attribute returned by reflection will be used when multiple TestMethodAttribute-derived attributes are present. Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Evangelink
approved these changes
Dec 7, 2025
# Conflicts: # src/Analyzers/MSTest.Analyzers/AnalyzerReleases.Unshipped.md # src/Analyzers/MSTest.Analyzers/Helpers/DiagnosticIds.cs # src/Analyzers/MSTest.Analyzers/Resources.resx # src/Analyzers/MSTest.Analyzers/xlf/Resources.cs.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.de.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.es.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.it.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.ja.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.ko.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.pl.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.pt-BR.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.ru.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.tr.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hans.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hant.xlf
Evangelink
reviewed
Dec 10, 2025
src/Analyzers/MSTest.Analyzers/DuplicateTestMethodAttributeAnalyzer.cs
Outdated
Show resolved
Hide resolved
# Conflicts: # src/Analyzers/MSTest.Analyzers/AnalyzerReleases.Unshipped.md # src/Analyzers/MSTest.Analyzers/Helpers/DiagnosticIds.cs # src/Analyzers/MSTest.Analyzers/Resources.resx # src/Analyzers/MSTest.Analyzers/xlf/Resources.cs.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.de.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.es.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.it.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.ja.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.ko.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.pl.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.pt-BR.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.ru.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.tr.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hans.xlf # src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hant.xlf
MarcoRossignoli
approved these changes
Dec 11, 2025
MarcoRossignoli
approved these changes
Dec 11, 2025
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.
Methods decorated with multiple
TestMethodAttribute-derived attributes compile but only the first attribute returned by reflection will be used, which can be confusing. For example:Changes
Analyzer Implementation
DuplicateTestMethodAttributeAnalyzerthat detects methods with >1TestMethodAttribute-derived attributeResources & Localization
Resources.resx.xlflocalization files with new entriesAnalyzerReleases.Unshipped.mdTests
DataTestMethodcombinations, edge casesOriginal prompt
💡 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.