Skip to content

Commit e5b81fc

Browse files
committed
article refresh
1 parent 115c54d commit e5b81fc

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

docs/test/create-a-unit-test-project.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,45 @@
11
---
2-
title: Create a unit test project
2+
title: Create a Unit Test Project
33
description: Learn how to create a unit test project. The test project can be in the same solution as the production code, or it can be in a separate solution.
4-
ms.date: 02/22/2023
4+
ms.date: 04/17/2025
55
ms.topic: how-to
66
ms.author: mikejo
77
manager: mijacobs
88
ms.subservice: test-tools
99
author: mikejo5000
10+
#customer intent: As a developer, I want to create unit test projects in Visual Studio so I can run unit tests on project code in my solution.
1011
---
1112
# Create a unit test project
1213

13-
Unit tests often mirror the structure of the code under test. For example, a unit test project would be created for each code project in the product. The test project can be in the same solution as the production code, or it can be in a separate solution. You can have multiple unit test projects in a solution.
14+
Unit tests often mirror the structure of the code under test. For example, a unit test project might be created for each code project in the product. The test project can be in the same solution as the production code, or it can be in a separate solution. You can have multiple unit test projects in a solution.
1415

1516
> [!NOTE]
16-
> The location of unit tests for native code and the test project structure can be different than the structure that's described in this article. For more information, see [Writing unit tests for C/C++](writing-unit-tests-for-c-cpp.md).
17+
> The location of unit tests for native code and the test project structure can be different from the structure described in this article. For more information, see [Writing unit tests for C/C++](writing-unit-tests-for-c-cpp.md).
1718
1819
## To create a unit test project
1920

2021
1. On the **File** menu, select **New** > **Project**, or press **Ctrl**+**Shift**+**N**.
2122

22-
2. On the **Create a new project** page, type **unit test** into the search box. Select the project template for the test framework that you want to use, for example **MSTest Test Project** or **NUnit Test Project**, and then select **Next**.
23+
1. On the **Create a new project** page, enter *unit test* in the search box. Select the project template for the test framework that you want to use, such as **MSTest Test Project** or **NUnit Test Project**, and then select **Next**.
2324

2425
::: moniker range=">=vs-2022"
25-
![Screenshot of test project templates in Visual Studio 2022.](media/vs-2022/test-project-templates.png)
26+
:::image type="content" source="media/vs-2022/test-project-templates.png" alt-text="Screenshot of test project templates in Visual Studio 2022.":::
2627
::: moniker-end
2728
::: moniker range="vs-2019"
28-
![Screenshot of test project templates in Visual Studio 2019.](media/vs-2019/test-project-templates.png)
29+
:::image type="content" source="media/vs-2019/test-project-templates.png" alt-text="Screenshot of test project templates in Visual Studio 2019.":::
2930
::: moniker-end
3031

31-
3. On the **Configure your new project** page, enter a name for your project, and then select **Create**.
32+
1. On the **Configure your new project** page, enter a name for your project, and then select **Create**.
3233

33-
4. In your unit test project, add a reference to the code under test. To add a reference to a code project in the same solution:
34+
1. In your unit test project, add a reference to the code under test. To add a reference to a code project in the same solution:
3435

35-
1. Select the test project in **Solution Explorer**.
36+
1. In **Solution Explorer**, right-click the test project, and select **Add** > **Reference**.
3637

37-
2. On the **Project** menu, select **Add Reference**.
38+
1. In **Reference Manager**, select the **Solution** node under **Projects**.
39+
40+
1. Select the code project you want to test, and then select **OK**.
3841

39-
3. In **Reference Manager**, select the **Solution** node under **Projects**. Select the code project you want to test, and then select **OK**.
40-
41-
If the code that you want to test is in another location, see [Managing references in a project](../ide/managing-references-in-a-project.md) for information about adding a reference.
42+
If the code you want to test is in another location, see [Managing references in a project](../ide/managing-references-in-a-project.md) for information about adding a reference.
4243

4344
## Related content
4445

0 commit comments

Comments
 (0)