diff --git a/docs/core/testing/unit-testing-mstest-migration-from-v1-to-v3.md b/docs/core/testing/unit-testing-mstest-migration-from-v1-to-v3.md index e2a59a4980bfc..a6f7e6791cfa3 100644 --- a/docs/core/testing/unit-testing-mstest-migration-from-v1-to-v3.md +++ b/docs/core/testing/unit-testing-mstest-migration-from-v1-to-v3.md @@ -3,7 +3,7 @@ title: MSTest migration to v3 description: Learn about migrating from legacy MSTest (MSTest v1) to latest MSTest (MSTest v3). author: engyebrahim ms.author: enjieid -ms.date: 11/06/2024 +ms.date: 11/28/2025 --- # MSTest v3 migration guide @@ -21,9 +21,9 @@ If your project relies on MSTest for unit testing and includes the above referen ### Why migrate to MSTest v3? -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: +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: -- **Enhanced security**: MSTest v1 has known security vulnerabilities. With MSTest v3, we’ve implemented extensive security improvements to safeguard your testing environment. +- **Enhanced security**: MSTest v1 has known security vulnerabilities. With MSTest v3, we've implemented extensive security improvements to safeguard your testing environment. - **Immediate Performance Boosts**: MSTest v3 significantly reduces test execution time and optimizes resource usage. This is particularly beneficial in CI/CD pipelines, where faster tests can shorten deployment cycles and cut infrastructure costs. - **Future-Proofing Your Tests**: MSTest v3 offers robust support for modern .NET versions, including .NET 8, and future iterations, along with cross-platform compatibility. This means your tests will be more adaptable and ready for upgrades, avoiding the technical debt of outdated testing frameworks. @@ -36,7 +36,10 @@ Even if you’re satisfied with your current MSTest setup, upgrading to MSTest v - **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. -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. +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. + +> [!TIP] +> After migrating to MSTest v3, consider taking a further step and migrate to MSTest v4. For more information, see [Migrate from MSTest v3 to v4](./unit-testing-mstest-migration-v3-v4.md). ## Migration steps @@ -54,7 +57,7 @@ In non-SDK style projects, these references are often added through Visual Studi 4. Inside the **References** folder, **find and select** the MSTest DLL references, `Microsoft.VisualStudio.QualityTools.UnitTestFramework` 5. **Right-click** the selected reference(s) and choose **Remove** from the context menu. - ![image](https://github.com/user-attachments/assets/7aff1afb-e26b-4450-bc2e-903a577e3df2) + ![Context menu of the assembly reference](https://github.com/user-attachments/assets/7aff1afb-e26b-4450-bc2e-903a577e3df2) 6. **Save the project** to apply changes. @@ -65,20 +68,20 @@ You can update your project to MSTest v3 in one of two ways: - **Update Packages**: If you have NuGet package references to the [MSTest.TestFramework](https://www.nuget.org/packages/MSTest.TestFramework) and the [MSTest.TestAdapter](https://www.nuget.org/packages/MSTest.TestAdapter/), update them using the NuGet Package Manager in Visual Studio or by running the following command in the NuGet Package Manager Console: ```shell - Update-Package MSTest.TestFramework -Version 3.6.2 - Update-Package MSTest.TestAdapter -Version 3.6.2 + Update-Package MSTest.TestFramework -Version 3.11.1 + Update-Package MSTest.TestAdapter -Version 3.11.1 ``` - **Or Install MSTest Package**: Install the latest [MSTest](https://www.nuget.org/packages/MSTest) package using the NuGet Package Manager in Visual Studio or by running the following command in the NuGet Package Manager Console: ```shell - Install-Package MSTest -Version 3.6.2 + Install-Package MSTest -Version 3.11.1 ``` - **Or update the project file directly** (for SDK-style projects): Update your `.csproj` file to specify the MSTest SDK version. ```xml - + net8.0 @@ -140,7 +143,7 @@ The DataRowAttribute constructors in MSTest v3 have been simplified to enforce t public void MyTestMethod(int number, string text) { ... } ``` -In cases where types don’t match exactly, MSTest v3 will now raise an error rather than attempting a conversion. +In cases where types don't match exactly, MSTest v3 will now raise an error rather than attempting a conversion. ### Timeout settings