Skip to content

Commit 68dd7b6

Browse files
Evangelinkgewarren
andauthored
Add MSTESTEXP doc (#44575)
Co-authored-by: Genevieve Warren <[email protected]>
1 parent 86328be commit 68dd7b6

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

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

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,38 @@ The rules are organized into categories such as performance usage...
1717

1818
## Categories
1919

20-
**[Design rules](design-rules.md)**
20+
### Design rules
2121

22-
Design rules will help you create and maintain test suites that adhere to proper design and good practices.
22+
[Design rules](design-rules.md) help you create and maintain test suites that adhere to proper design and good practices.
2323

24-
**[Performance rules](performance-rules.md)**
24+
### Performance rules
2525

26-
Rules that support high-performance testing.
26+
[Performance rules](performance-rules.md) support high-performance testing.
2727

28-
**[Suppression rules](suppression-rules.md)**
28+
### Suppression rules
2929

30-
Rules that support suppressing diagnostics from other rules.
30+
[Suppression rules](suppression-rules.md) support suppressing diagnostics from other rules.
3131

32-
**[Usage rules](usage-rules.md)**
32+
### Usage rules
3333

34-
Rules that support proper usage of MSTest.
34+
[Usage rules](usage-rules.md) support proper usage of MSTest.
35+
36+
### MSTESTEXP
37+
38+
Several APIs of MSTest are decorated with the <xref:System.Diagnostics.CodeAnalysis.ExperimentalAttribute>. This attribute indicates that the API is experimental and may be removed or changed in future versions of MSTest. The attribute is used to identify APIs that aren't yet stable and may not be suitable for production use.
39+
40+
The MSTESTEXP diagnostic alerts you to use of an experimental API in your code. To suppress this diagnostic with the `SuppressMessageAttribute`, add the following code to your project:
41+
42+
```csharp
43+
using System.Diagnostics.CodeAnalysis;
44+
45+
[assembly: SuppressMessage("MSTESTEXP", "Justification")]
46+
```
47+
48+
Alternatively, you can suppress this diagnostic with preprocessor directive by adding the following code to your project:
49+
50+
```csharp
51+
#pragma warning disable MSTESTEXP
52+
// API that is causing the warning.
53+
#pragma warning restore MSTESTEXP
54+
```

0 commit comments

Comments
 (0)