Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/core/testing/mstest-analyzers/design-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ Identifier | Name | Description
[MSTEST0021](mstest0021.md) | PreferDisposeOverTestCleanupAnalyzer | Prefer Dispose over TestCleanup methods
[MSTEST0022](mstest0022.md) | PreferTestCleanupOverDisposeAnalyzer | Prefer TestCleanup over Dispose methods
[MSTEST0025](mstest0025.md) | PreferAssertFailOverAlwaysFalseConditionsAnalyzer | Use 'Assert.Fail' instead of an always-failing assert
[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.
[MSTEST0036](mstest0036.md) | DoNotUseShadowingAnalyzer | Shadowing test members could cause testing issues (such as NRE).
2 changes: 1 addition & 1 deletion docs/core/testing/mstest-analyzers/mstest0034.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ helpviewer_keywords:
author: engyebrahim
ms.author: enjieid
---
# MSTEST0034: Use `ClassCleanupBehavior.EndOfClass` with the `[ClassCleanup]`.
# MSTEST0034: Use `ClassCleanupBehavior.EndOfClass` with the `[ClassCleanup]`

| Property | Value |
|-------------------------------------|------------------------------------------------------------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/core/testing/mstest-analyzers/mstest0035.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ helpviewer_keywords:
author: engyebrahim
ms.author: enjieid
---
# MSTEST0035: `[DeploymentItem]` can be specified only on test class or test method.
# MSTEST0035: `[DeploymentItem]` can be specified only on test class or test method

| Property | Value |
|-------------------------------------|------------------------------------------------------------------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/core/testing/mstest-analyzers/mstest0036.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ helpviewer_keywords:
author: engyebrahim
ms.author: enjieid
---
# MSTEST0036: Do not use shadowing inside test class.
# MSTEST0036: Do not use shadowing inside test class

| Property | Value |
|-------------------------------------|------------------------------------------------------------------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/core/testing/mstest-analyzers/mstest0038.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ms.author: ygerges
| **Enabled by default** | Yes |
| **Default severity** | Warning |
| **Introduced in version** | 3.8.0 |
| **Is there a code fix** | No |
| **Is there a code fix** | Yes |

## Cause

Expand Down
6 changes: 6 additions & 0 deletions docs/core/testing/mstest-analyzers/usage-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ Identifier | Name | Description
[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...).
[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
[MSTEST0017](mstest0017.md) | AssertionArgsShouldBePassedInCorrectOrder | Assertion arguments should be passed in the correct order
[MSTEST0018](mstest0018.md) | DynamicDataShouldBeValidAnalyzer | Methods marked with `[DynamicData]` should also be marked with `[TestMethod]` (or a derived attribute)
[MSTEST0023](mstest0023.md) | DoNotNegateBooleanAssertionAnalyzer | Do not negate boolean assertions
[MSTEST0024](mstest0024.md) | DoNotStoreStaticTestContextAnalyzer | Do not store TestContext in a static member
[MSTEST0026](mstest0026.md) | AssertionArgsShouldAvoidConditionalAccessRuleId | Avoid conditional access in assertions
[MSTEST0030](mstest0030.md) | TypeContainingTestMethodShouldBeATestClass | Type containing `[TestMethod]` should be marked with `[TestClass]`
[MSTEST0031](mstest0031.md) | DoNotUseSystemDescriptionAttribute | 'System.ComponentModel.DescriptionAttribute' has no effect in the context of tests
[MSTEST0032](mstest0032.md) | ReviewAlwaysTrueAssertConditionAnalyzer | Review or remove the assertion as its condition is known to be always true
[MSTEST0034](mstest0034.md) | UseClassCleanupBehaviorEndOfClass | Use `ClassCleanupBehavior.EndOfClass` with the `[ClassCleanup]`
[MSTEST0035](mstest0035.md) | UseDeploymentItemWithTestMethodOrTestClassTitle | `[DeploymentItem]` can be specified only on test class or test method
[MSTEST0037](mstest0037.md) | UseProperAssertMethodsAnalyzer | Use proper `Assert` methods
[MSTEST0038](mstest0038.md) | AvoidAssertAreSameWithValueTypesAnalyzer | Don't use `Assert.AreSame` or `Assert.AreNotSame` with value types
2 changes: 2 additions & 0 deletions docs/navigate/devops-testing/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ items:
href: ../../core/testing/mstest-analyzers/mstest0035.md
- name: MSTEST0037
href: ../../core/testing/mstest-analyzers/mstest0037.md
- name: MSTEST0038
href: ../../core/testing/mstest-analyzers/mstest0038.md
- name: Microsoft Testing Platform
items:
- name: Overview
Expand Down
Loading