Skip to content

Commit 6e234bd

Browse files
authored
Update MSTest analyzer docs (#44397)
* Update MSTest analyzer docs * Fix markdownlint violation
1 parent 42b412a commit 6e234bd

File tree

7 files changed

+14
-4
lines changed

7 files changed

+14
-4
lines changed

docs/core/testing/mstest-analyzers/design-rules.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ Identifier | Name | Description
2121
[MSTEST0021](mstest0021.md) | PreferDisposeOverTestCleanupAnalyzer | Prefer Dispose over TestCleanup methods
2222
[MSTEST0022](mstest0022.md) | PreferTestCleanupOverDisposeAnalyzer | Prefer TestCleanup over Dispose methods
2323
[MSTEST0025](mstest0025.md) | PreferAssertFailOverAlwaysFalseConditionsAnalyzer | Use 'Assert.Fail' instead of an always-failing assert
24+
[MSTEST0029](mstest0029.md) | PublicMethodShouldBeTestMethod | A `public` method of a class marked with `[TestClass]` should be a test method (marked with `[TestMethod]`). The rule ignores methods that are marked with `[TestInitialize]`, or `[TestCleanup]` attributes.
25+
[MSTEST0036](mstest0036.md) | DoNotUseShadowingAnalyzer | Shadowing test members could cause testing issues (such as NRE).

docs/core/testing/mstest-analyzers/mstest0034.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ helpviewer_keywords:
1111
author: engyebrahim
1212
ms.author: enjieid
1313
---
14-
# MSTEST0034: Use `ClassCleanupBehavior.EndOfClass` with the `[ClassCleanup]`.
14+
# MSTEST0034: Use `ClassCleanupBehavior.EndOfClass` with the `[ClassCleanup]`
1515

1616
| Property | Value |
1717
|-------------------------------------|------------------------------------------------------------------|

docs/core/testing/mstest-analyzers/mstest0035.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ helpviewer_keywords:
1111
author: engyebrahim
1212
ms.author: enjieid
1313
---
14-
# MSTEST0035: `[DeploymentItem]` can be specified only on test class or test method.
14+
# MSTEST0035: `[DeploymentItem]` can be specified only on test class or test method
1515

1616
| Property | Value |
1717
|-------------------------------------|------------------------------------------------------------------------|

docs/core/testing/mstest-analyzers/mstest0036.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ helpviewer_keywords:
1111
author: engyebrahim
1212
ms.author: enjieid
1313
---
14-
# MSTEST0036: Do not use shadowing inside test class.
14+
# MSTEST0036: Do not use shadowing inside test class
1515

1616
| Property | Value |
1717
|-------------------------------------|------------------------------------------------------------------------|

docs/core/testing/mstest-analyzers/mstest0038.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ms.author: ygerges
2222
| **Enabled by default** | Yes |
2323
| **Default severity** | Warning |
2424
| **Introduced in version** | 3.8.0 |
25-
| **Is there a code fix** | No |
25+
| **Is there a code fix** | Yes |
2626

2727
## Cause
2828

docs/core/testing/mstest-analyzers/usage-rules.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ Identifier | Name | Description
2424
[MSTEST0013](mstest0013.md) | AssemblyCleanupShouldBeValidAnalyzer | Methods marked with `[AssemblyCleanup]` should follow the following layout to be valid:<br/>- it should be `public` <br/>- it should be `static`<br/>- it should not be generic<br/>- it should not take any parameter<br/>- return type should be `void`, `Task` or `ValueTask`<br/>- it should not be `async void`<br/>- it should not be a special method (finalizer, operator...).
2525
[MSTEST0014](mstest0014.md) | DataRowShouldBeValidAnalyzer | `[DataRow]` instances should have the following layout to be valid:<br/>- they should only be set on a test method<br/>- argument count should match method parameters count<br/>- argument type should match method argument type
2626
[MSTEST0017](mstest0017.md) | AssertionArgsShouldBePassedInCorrectOrder | Assertion arguments should be passed in the correct order
27+
[MSTEST0018](mstest0018.md) | DynamicDataShouldBeValidAnalyzer | Methods marked with `[DynamicData]` should also be marked with `[TestMethod]` (or a derived attribute)
2728
[MSTEST0023](mstest0023.md) | DoNotNegateBooleanAssertionAnalyzer | Do not negate boolean assertions
2829
[MSTEST0024](mstest0024.md) | DoNotStoreStaticTestContextAnalyzer | Do not store TestContext in a static member
2930
[MSTEST0026](mstest0026.md) | AssertionArgsShouldAvoidConditionalAccessRuleId | Avoid conditional access in assertions
31+
[MSTEST0030](mstest0030.md) | TypeContainingTestMethodShouldBeATestClass | Type containing `[TestMethod]` should be marked with `[TestClass]`
32+
[MSTEST0031](mstest0031.md) | DoNotUseSystemDescriptionAttribute | 'System.ComponentModel.DescriptionAttribute' has no effect in the context of tests
33+
[MSTEST0032](mstest0032.md) | ReviewAlwaysTrueAssertConditionAnalyzer | Review or remove the assertion as its condition is known to be always true
34+
[MSTEST0034](mstest0034.md) | UseClassCleanupBehaviorEndOfClass | Use `ClassCleanupBehavior.EndOfClass` with the `[ClassCleanup]`
35+
[MSTEST0035](mstest0035.md) | UseDeploymentItemWithTestMethodOrTestClassTitle | `[DeploymentItem]` can be specified only on test class or test method
3036
[MSTEST0037](mstest0037.md) | UseProperAssertMethodsAnalyzer | Use proper `Assert` methods
3137
[MSTEST0038](mstest0038.md) | AvoidAssertAreSameWithValueTypesAnalyzer | Don't use `Assert.AreSame` or `Assert.AreNotSame` with value types

docs/navigate/devops-testing/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ items:
191191
href: ../../core/testing/mstest-analyzers/mstest0035.md
192192
- name: MSTEST0037
193193
href: ../../core/testing/mstest-analyzers/mstest0037.md
194+
- name: MSTEST0038
195+
href: ../../core/testing/mstest-analyzers/mstest0038.md
194196
- name: Microsoft Testing Platform
195197
items:
196198
- name: Overview

0 commit comments

Comments
 (0)