Skip to content

[Test Improver] Add tests for UseConditionBaseWithTestClassAnalyzer (MSTEST0041)#7809

Merged
Evangelink merged 1 commit into
mainfrom
test-assist/useConditionBaseWithTestClass-tests-285b5ab1b712039b
Apr 24, 2026
Merged

[Test Improver] Add tests for UseConditionBaseWithTestClassAnalyzer (MSTEST0041)#7809
Evangelink merged 1 commit into
mainfrom
test-assist/useConditionBaseWithTestClass-tests-285b5ab1b712039b

Conversation

@Evangelink
Copy link
Copy Markdown
Member

Add 9 unit tests covering the UseConditionBaseWithTestClassAnalyzer which warns when a ConditionBaseAttribute-derived attribute is applied to a class without TestClassAttribute.

Add 9 unit tests covering the UseConditionBaseWithTestClassAnalyzer
which warns when a ConditionBaseAttribute-derived attribute is applied
to a class without TestClassAttribute.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 24, 2026 09:30
Copy link
Copy Markdown
Contributor

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

Adds unit test coverage for MSTEST0041 (UseConditionBaseWithTestClassAnalyzer), ensuring the analyzer correctly warns when ConditionBaseAttribute-derived attributes are applied to non-[TestClass] types, while allowing valid usages.

Changes:

  • Introduces a new analyzer test suite covering both diagnostic and non-diagnostic scenarios for built-in condition attributes (OSCondition, CICondition).
  • Adds coverage for custom ConditionBaseAttribute derivatives and for derived TestClassAttribute scenarios.
Show a summary per file
File Description
test/UnitTests/MSTest.Analyzers.UnitTests/UseConditionBaseWithTestClassAnalyzerTests.cs Adds 9 unit tests validating MSTEST0041 diagnostics across built-in and custom condition attributes, including derived TestClassAttribute cases.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@Evangelink Evangelink enabled auto-merge (squash) April 24, 2026 11:33
@Evangelink Evangelink merged commit 152442f into main Apr 24, 2026
35 checks passed
@Evangelink Evangelink deleted the test-assist/useConditionBaseWithTestClass-tests-285b5ab1b712039b branch April 24, 2026 11:39
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.

3 participants