|
1 | 1 | ---
|
2 |
| -title: Install third-party unit test frameworks |
3 |
| -description: Visual Studio Test Explorer can run tests from any unit test framework that has developed an adapter interface for it. |
4 |
| -ms.date: 12/04/2023 |
| 2 | +title: Install Third-party Unit Test Frameworks |
| 3 | +description: Visual Studio Test Explorer can run tests from any unit test framework that has an adapter interface available. |
| 4 | +ms.date: 04/17/2025 |
5 | 5 | ms.topic: how-to
|
6 | 6 | ms.author: mikejo
|
7 | 7 | manager: mijacobs
|
8 | 8 | ms.subservice: test-tools
|
9 | 9 | author: mikejo5000
|
| 10 | +#customer intent: As a developer, I want to install unit test frameworks from other parties so I can run unit tests from any unit test framework in Visual Studio. |
10 | 11 | ---
|
11 | 12 | # Install unit test frameworks
|
12 | 13 |
|
13 |
| -Visual Studio Test Explorer can run tests from any unit test framework that has developed an adapter interface for it. Installing the framework copies the binaries and adds Visual Studio project templates for the languages it supports. When you create a project with the template, the framework is registered with Test Explorer. |
| 14 | +Visual Studio Test Explorer can run tests from any unit test framework that has an adapter interface available. Installing the framework copies the binaries and adds Visual Studio project templates for the languages it supports. When you create a project with the template, the framework is registered with Test Explorer. |
14 | 15 |
|
15 | 16 | A Visual Studio solution can contain unit test projects that use different frameworks and that are targeted at different languages.
|
16 | 17 |
|
17 |
| -For .NET, [MSTest, NUnit, and xUnit](getting-started-with-unit-testing.md) are the test frameworks provided by Visual Studio which are installed by default. For C++, a different set of test frameworks are provided, such as CTest. |
| 18 | +For .NET, [MSTest, NUnit, and xUnit](getting-started-with-unit-testing.md) are the test frameworks provided by Visual Studio, which are installed by default. For C++, a different set of test frameworks are provided, such as CTest. |
18 | 19 |
|
19 | 20 | ## Acquire frameworks
|
20 | 21 |
|
21 |
| -Install third-party unit test frameworks by using **NuGet Package Manager**. |
| 22 | +Install third-party unit test frameworks by using **NuGet Package Manager**: |
22 | 23 |
|
23 |
| -1. Right-click on the project that will contain your test code and select **Manage NuGet Packages**. |
| 24 | +1. In **Solution Explorer**, right-click the project for your test code, and select **Manage NuGet Packages**. |
24 | 25 |
|
25 |
| -2. In **NuGet Package Manager**, search for the test framework you want to install, and then click **Install**. |
| 26 | +1. In **NuGet Package Manager**, search for the test framework you want to install: |
26 | 27 |
|
27 | 28 | ::: moniker range=">=vs-2022"
|
28 |
| -  |
| 29 | + :::image type="content" source="media/vs-2022/nuget-package-manager.png" alt-text="Screenshot of NuGet Package Manager in Visual Studio 2022."::: |
29 | 30 | ::: moniker-end
|
30 | 31 | ::: moniker range="vs-2019"
|
31 |
| -  |
| 32 | + :::image type="content" source="media/vs-2019/nuget-package-manager.png" alt-text="Screenshot of NuGet Package Manager in Visual Studio 2019."::: |
32 | 33 | ::: moniker-end
|
33 | 34 |
|
| 35 | +1. Select the framework and then select **Install**. |
| 36 | + |
34 | 37 | ## Update to the latest test adapters
|
35 | 38 |
|
36 | 39 | Update to the latest stable test adapter to experience better test discovery and execution. For more information about updates to MSTest, NUnit, and xUnit test adapters, see the [Visual Studio blog](https://devblogs.microsoft.com/visualstudio/test-experience-improvements/).
|
37 | 40 |
|
38 | 41 | ### To update to the latest stable test adapter version
|
39 | 42 |
|
40 |
| -1. Open the NuGet Package Manager for your solution by navigating to **Tools** > **NuGet Package Manager** > **Manage NuGet Packages for Solution**. |
| 43 | +1. Open **NuGet Package Manager** for your solution by selecting **Tools** > **NuGet Package Manager** > **Manage NuGet Packages for Solution**. |
41 | 44 |
|
42 |
| -2. Click on the **Updates** tab and search for MSTest, NUnit, or xUnit test adapters that are installed. |
| 45 | +1. Select the **Updates** tab and search for MSTest, NUnit, or xUnit test adapters that are installed. |
43 | 46 |
|
44 |
| -3. Select each test adapter, and then select the button to update to a new version. |
| 47 | +1. Select the checkbox next to each test adapter you want to refresh, and then select **Update** to install the latest version of each adapter. |
45 | 48 |
|
46 | 49 | ::: moniker range=">=vs-2022"
|
47 |
| -  |
| 50 | + |
| 51 | + :::image type="content" source="media/vs-2022/install-adapter-upgrade.png" alt-text="Screenshot of Upgrade Test Adapter in Visual Studio 2022."::: |
| 52 | + |
| 53 | + If the **Preview changes** dialog opens, confirm your selection, and select **Apply**. Accept any licensing changes, as needed. |
| 54 | + |
48 | 55 | ::: moniker-end
|
49 | 56 | ::: moniker range="vs-2019"
|
50 |
| -  |
51 | 57 |
|
52 |
| - Choose the **Install** button. |
| 58 | + :::image type="content" source="media/install-adapter-upgrade.png" alt-text="Screenshot of Upgrade Test Adapter in Visual Studio 2019."::: |
| 59 | + |
| 60 | + Select **Install**. |
| 61 | + |
53 | 62 | ::: moniker-end
|
54 | 63 |
|
55 | 64 | ## Related content
|
|
0 commit comments