Skip to content

Commit 109ddd6

Browse files
authored
Update unit-testing-mstest-migration-from-v1-to-v3.md
balnk with headings
1 parent 223acf1 commit 109ddd6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/core/testing/unit-testing-mstest-migration-from-v1-to-v3.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# MSTest v3 Migration Guide
33

44
## Overview
5+
56
This guide assists users in upgrading their MSTest projects from v0/v1 to MSTest v3. MSTest v3 introduces new features, improvements, and some breaking changes.
67

78
---
@@ -74,6 +75,7 @@ Remove the `Microsoft.VisualStudio.QualityTools.UnitTestFramework` reference fro
7475
## Breaking Changes and Removed APIs
7576

7677
### Assertion Overloads
78+
7779
MSTest v3 removes certain `Assert` overloads that accept object types to promote type-safe assertions. Update tests using these overloads to specify types explicitly.
7880

7981
**Example**:
@@ -87,6 +89,7 @@ Assert.AreEqual<int>(expectedInt, actualInt); // specify the type
8789
```
8890

8991
### DataRowAttribute Updates
92+
9093
The `DataRowAttribute` constructors have been simplified in MSTest v3. Update parameterized tests using `DataRow` to align with the revised constructors.
9194

9295
**Example**:
@@ -98,13 +101,15 @@ public void MyTestMethod(int number, string text) { ... }
98101
```
99102

100103
### Timeout Settings
104+
101105
Timeout settings are standardized across frameworks in MSTest v3. Verify and adjust any timeout configurations in existing tests for compatibility.
102106

103107
---
104108

105109
## Configuration Changes
106110

107111
### Settings and Configuration Files
112+
108113
MSTest v3 supports both XML and JSON formats for configuration files.
109114

110115
1. **Verify Configurations**: Ensure that existing `.runsettings` files align with MSTest v3’s syntax and structure.
@@ -115,6 +120,7 @@ MSTest v3 supports both XML and JSON formats for configuration files.
115120
## Parallel Execution and Performance Optimization
116121

117122
### New Parallelism Options
123+
118124
Configure parallel execution in `.runsettings` or JSON configuration files to improve performance.
119125

120126
**Example**:
@@ -128,23 +134,27 @@ Configure parallel execution in `.runsettings` or JSON configuration files to im
128134
```
129135

130136
### Improved Resource Usage
137+
131138
MSTest v3 optimizes resource management, resulting in lower memory usage and better CPU efficiency.
132139

133140
---
134141

135142
## Handling Obsolete Attributes and Migrating Custom Extensions
143+
136144
Review deprecated attributes, such as `[DeploymentItem]`, and replace them with MSTest v3 alternatives where possible.
137145

138146
---
139147

140148
## Code Analyzers and Best Practices
149+
141150
MSTest v3 includes built-in code analyzers for best practices, avoiding configuration pitfalls, and proper use of MSTest attributes and settings.
142151

143152
---
144153

145154
## Sample Code: Migration Example
146155

147156
### Before (MSTest v1)
157+
148158
```csharp
149159
[TestMethod]
150160
[Timeout(1000)]
@@ -155,6 +165,7 @@ public void ExampleTestMethod(int number, string data) {
155165
```
156166

157167
### After (MSTest v3)
168+
158169
```csharp
159170
[TestMethod]
160171
[Timeout(1000)]

0 commit comments

Comments
 (0)