Skip to content

Commit 75da548

Browse files
engyebrahimIEvangelistgewarren
authored
MSTEST0029: Public methods should be test methods (#41298)
* Create mstest0029 * Update mstest0029.md * Update toc.yml * Update mstest0029.md * Apply suggestions from code review Co-authored-by: Genevieve Warren <[email protected]> --------- Co-authored-by: David Pine <[email protected]> Co-authored-by: Genevieve Warren <[email protected]>
1 parent e92b6e3 commit 75da548

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: "MSTEST0029: Public method should be test method"
3+
description: "Learn about code analysis rule MSTEST0029: Public method should be test method"
4+
ms.date: 04/06/2024
5+
f1_keywords:
6+
- MSTEST0029
7+
- PublicMethodShouldBeTestMethod
8+
helpviewer_keywords:
9+
- PublicMethodShouldBeTestMethod
10+
- MSTEST0029
11+
author: engyebrahim
12+
ms.author: enjieid
13+
---
14+
# MSTEST0029: Public method should be test method
15+
16+
| Property | Value |
17+
|-------------------------------------|----------------------------------------------|
18+
| **Rule ID** | MSTEST0029 |
19+
| **Title** | Public method should be test method |
20+
| **Category** | Design |
21+
| **Fix is breaking or non-breaking** | Non-breaking |
22+
| **Enabled by default** | No |
23+
| **Default severity** | Info |
24+
| **Introduced in version** | 3.5.0 |
25+
26+
## Cause
27+
28+
A Public method should be a test method.
29+
30+
## Rule description
31+
32+
A Public method should be a test method (marked with `[TestMethod]`).
33+
34+
## How to fix violations
35+
36+
Ensure that the public method is a test method (marked with `[TestMethod]`).
37+
38+
## When to suppress warnings
39+
40+
Do not suppress a warning from this rule. If you ignore this rule, the public method won't be considered as a test method.

docs/navigate/devops-testing/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ items:
101101
href: ../../core/testing/mstest-analyzers/mstest0022.md
102102
- name: MSTEST0025
103103
href: ../../core/testing/mstest-analyzers/mstest0025.md
104+
- name: MSTEST0029
105+
href: ../../core/testing/mstest-analyzers/mstest0029.md
104106
- name: Performance
105107
items:
106108
- name: Overview

0 commit comments

Comments
 (0)