Skip to content

Commit 66e7a3c

Browse files
authored
Create mstest0035.md (#42005)
* Create mstest0035.md * Update toc.yml * Update mstest0035.md * Update mstest0035.md
1 parent ca031bd commit 66e7a3c

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "[DeploymentItem] can be specified only on test class or test method."
3+
description: "Learn about code analysis rule MSTEST0035: `[DeploymentItem]` can be specified only on test class or test method."
4+
ms.date: 08/02/2024
5+
f1_keywords:
6+
- MSTEST0035
7+
- UseDeploymentItemWithTestMethodOrTestClassTitle
8+
helpviewer_keywords:
9+
- UseDeploymentItemWithTestMethodOrTestClassTitle
10+
- MSTEST0035
11+
author: engyebrahim
12+
ms.author: enjieid
13+
---
14+
# MSTEST0035: `[DeploymentItem]` can be specified only on test class or test method.
15+
16+
| Property | Value |
17+
|-------------------------------------|------------------------------------------------------------------------|
18+
| **Rule ID** | MSTEST0035 |
19+
| **Title** | `[DeploymentItem]` can be specified only on test class or test method. |
20+
| **Category** | Usage |
21+
| **Fix is breaking or non-breaking** | Non-breaking |
22+
| **Enabled by default** | Yes |
23+
| **Default severity** | Info |
24+
| **Introduced in version** | 3.6.0 |
25+
26+
## Cause
27+
28+
This rule raises a diagnostic when `[DeploymentItem]` isn't set on test class or test method.
29+
30+
## Rule description
31+
32+
With using `[DeploymentItem]`, without putting it on test class or test method itwill be ignored.
33+
34+
## How to fix violations
35+
36+
Ensure the attribute `[DeploymentItem]` is specified on a test class or a test method, otherwise remove the attribute.
37+
38+
## When to suppress warnings
39+
40+
It's _not_ recommended to suppress warnings from this rule as the `[DeploymentItem]` will be ignored.

docs/navigate/devops-testing/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ items:
169169
href: ../../core/testing/mstest-analyzers/mstest0032.md
170170
- name: MSTEST0034
171171
href: ../../core/testing/mstest-analyzers/mstest0034.md
172+
- name: MSTEST0035
173+
href: ../../core/testing/mstest-analyzers/mstest0035.md
172174
- name: Microsoft Testing Platform
173175
items:
174176
- name: Overview

0 commit comments

Comments
 (0)