Skip to content

Commit cf98bd3

Browse files
authored
Update unit-testing-mstest-migration-from-v1-to-v3.md
1 parent ba7dcf1 commit cf98bd3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ms.date: 11/06/2024
99
# MSTest v3 migration guide
1010

1111
This guide assists users in upgrading their MSTest projects from MSTest v1 to MSTest v3. MSTest v3 introduces significant new features, optimizations, and some breaking changes to improve test reliability, execution speed, and compatibility with modern .NET frameworks.
12+
1213
### Who is impacted?
1314

1415
This guide is intended for projects currently **.NET Framework projects** using MSTest v1 via either:
@@ -17,6 +18,7 @@ This guide is intended for projects currently **.NET Framework projects** using
1718
- **NuGet packages**: Projects using `MSTest.TestFramework` NuGet package with version 1.0.0-1.4.0.
1819

1920
If your project relies on MSTest for unit testing and includes the above references, it will benefit from the improvements in MSTest v3 and requires adjustments outlined in this guide.
21+
2022
### Why migrate to MSTest v3?
2123

2224
Even if you’re satisfied with your current MSTest setup, upgrading to MSTest v3 unlocks substantial advantages that improve both the quality and future-readiness of your tests. Here’s why making the switch now can be a valuable step forward:
@@ -35,6 +37,7 @@ Even if you’re satisfied with your current MSTest setup, upgrading to MSTest v
3537
- **Greater Flexibility and Extensibility**: MSTest v3 supports advanced testing scenarios, including dynamic data sources and in-assembly parallel execution. This flexibility enables more sophisticated testing approaches and speeds up test suites without complex configurations.
3638

3739
By upgrading, you’re setting up your tests to be faster, more reliable, and adaptable to future .NET developments, positioning your project for long-term success and easier maintenance.
40+
3841
## Migration steps
3942

4043
### 1. Remove assembly reference
@@ -99,6 +102,7 @@ Choose the option that best suits your project setup. Both methods ensure your p
99102
- **Test Initialization**: Use `TestInitialize` methods for async initialization.
100103
- **Cleanup**: Use `TestCleanup` methods or the `Dispose` pattern for cleanup.
101104
- **RunSettings**: The `.testsettings` file is no longer supported, meaning `<LegacySettings>` is also no longer available. Use [.runsettings](/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file) for test configuration.
105+
102106
## New Features in MSTest v3
103107

104108
- Improved defaults for test projects
@@ -108,6 +112,7 @@ Choose the option that best suits your project setup. Both methods ensure your p
108112
- Support for WinUI applications
109113
- In-assembly parallel execution
110114
- Dynamic data sources for data-driven tests
115+
111116
## Deprecated Features
112117

113118
- Dropped support for:
@@ -116,6 +121,7 @@ Choose the option that best suits your project setup. Both methods ensure your p
116121
- **UWP versions before 16299**
117122
- **WinUI versions before 18362**
118123
- **.NET 5** (use .NET Core 3.1 or .NET 6)
124+
119125
## Breaking Changes and Removed APIs
120126

121127
### Assertion overloads
@@ -162,6 +168,7 @@ public void TestMethod() { ... }
162168
[Timeout(2000)] // Verify this value still works under MSTest v3
163169
public async Task TestMethod() { ... }
164170
```
171+
165172
## Configuration changes
166173
MSTest v3 supports both XML and JSON formats for configuration files.
167174

0 commit comments

Comments
 (0)