Skip to content

Commit c780b2f

Browse files
committed
edit pass: test-explorer-articles
1 parent a710d65 commit c780b2f

File tree

2 files changed

+56
-48
lines changed

2 files changed

+56
-48
lines changed

docs/test/debug-unit-tests-with-test-explorer.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ You can use Test Explorer to start a debugging session for your tests. Stepping
2828
![Screenshot that shows test execution details.](../test/media/vs-2019/test-explorer-debug.png)
2929
::: moniker-end
3030

31-
For more information, about the debugger, see [Debug in Visual Studio](../debugger/debugger-feature-tour.md).
31+
For more information about the debugger, see [Debug in Visual Studio](../debugger/debugger-feature-tour.md).
3232

3333
## Diagnose performance problems with a test method
3434

3535
::: moniker range=">=vs-2022"
36-
Starting in Visual Studio 2022 version 17.8, you can use any applicable tool in the Performance Profiler to help improve your code, and not just the Instrumentation tool. You can profile small units of work in isolation, make changes, and then remeasure and validate the impact of the change.
36+
Starting in Visual Studio 2022 version 17.8, you can use any applicable tool in the Performance Profiler to help improve your code, and not just the Instrumentation tool. You can profile small units of work in isolation, make changes, and then remeasure and validate the impact of the changes.
3737

3838
To diagnose why a test method is taking more time than you'd like, or using more memory than you'd like:
3939

40-
1. Select the method in Test Explorer, right-click on the pane, and then select **Profile**.
40+
1. Right-click the method in Test Explorer, and then select **Profile**.
4141
1. In the Performance Profiler, select a profiling tool to test your code.
4242

4343
For more information, see [this blog post](https://devblogs.microsoft.com/visualstudio/a-unit-of-profiling-makes-the-allocations-go-away/) or see [Collect profiling data without debugging](../profiling/running-profiling-tools-with-or-without-the-debugger.md#collect-profiling-data-without-debugging).
@@ -46,7 +46,7 @@ For more information, see [this blog post](https://devblogs.microsoft.com/visual
4646
::: moniker range="vs-2019"
4747
To diagnose why a test method is taking too much time:
4848

49-
- Select the method in Test Explorer, right-click on the pane, and then select **Profile**.
49+
- Right-click the method in Test Explorer, and then select **Profile**.
5050

5151
For more information, see [Instrumentation profiling report](../profiling/understanding-instrumentation-data-values.md?view=vs-2017&preserve-view=true).
5252

@@ -58,17 +58,17 @@ For more information, see [Instrumentation profiling report](../profiling/unders
5858

5959
## Get AI assistance to debug tests
6060

61-
Starting in Visual Studio 2022 version 17.12 Preview 2, you can get quick assistance from GitHub Copilot to debug tests if you have an [active Copilot subscription](../ide/visual-studio-github-copilot-chat.md#prerequisites). To get help, right-click a failed test in Test Explorer, and then do one of the following:
61+
Starting in Visual Studio 2022 version 17.12 Preview 2, you can get quick assistance from GitHub Copilot to debug tests if you have an [active Copilot subscription](../ide/visual-studio-github-copilot-chat.md#prerequisites). To get help, right-click a failed test in Test Explorer, and then select of the following commands:
6262

63-
- Select **Explain failure with Copilot**.
64-
- Select **Debug with Copilot**.
63+
- **Explain failure with Copilot**
64+
- **Debug with Copilot**
6565

6666
![Screenshot of debugging tests with Copilot.](../test/media/vs-2022/debug-tests-with-copilot.png)
6767

6868
If you debug with GitHub Copilot:
6969

7070
1. It provides you with a debug plan.
71-
1. It sets appropriate breakpoints and watch variables
71+
1. It sets appropriate breakpoints and watch variables.
7272
1. It starts the debug session.
7373

7474
When the debugger hits the breakpoint, it provides GitHub Copilot with values for the watched variables. Copilot then determines your next step: either continue debugging or fix the problem code. You can continue the Copilot Chat conversation until you have a passing test.

docs/test/test-explorer-faq.md

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Review Test Explorer FAQ issues and answers
2+
title: Review Test Explorer FAQ Issues and Answers
33
description: Review frequently asked questions (FAQs) about Visual Studio Test Explorer, which include some common troubleshooting scenarios.
44
ms.date: 06/25/2020
55
ms.topic: conceptual
@@ -19,109 +19,117 @@ ms.subservice: test-tools
1919

2020
## Dynamic test discovery
2121

22-
**Test Explorer is not discovering my tests that are dynamically defined. (For example, theories, custom adapters, custom traits, #ifdefs, etc.) How can I discover these tests?**
22+
**Test Explorer is not discovering my tests that are dynamically defined (for example, theories, custom adapters, custom traits, and #ifdef statements). How can I discover these tests?**
2323

2424
Build your project to run assembly-based discovery.
2525

26-
[Real-time test discovery](https://devblogs.microsoft.com/dotnet/real-time-test-discovery/) is source-based test discovery. It cant discover tests that use theories, custom adapters, custom traits, `#ifdef` statements, and more because they're defined at run time. A build is required for those tests to be accurately found. In Visual Studio 2017 version 15.6 and later, assembly-based discovery (the traditional discoverer) runs only after builds. This setting means real-time test discovery finds as many tests as it can while you're editing, and assembly-based discovery allows dynamically defined tests to appear after a build. Real-time test discovery improves responsiveness, but still allows you to get complete and precise results after a build.
26+
[Real-time test discovery](https://devblogs.microsoft.com/dotnet/real-time-test-discovery/) is source-based test discovery. It can't discover tests that use theories, custom adapters, custom traits, `#ifdef` statements, and more because they're defined at runtime. A build is required for those tests to be accurately found.
2727

28-
## Test Explorer '+' (plus) symbol
28+
In Visual Studio 2017 version 15.6 and later, assembly-based discovery (the traditional discoverer) runs only after builds. This setting means real-time test discovery finds as many tests as it can while you're editing. Assembly-based discovery allows dynamically defined tests to appear after a build.
2929

30-
**What does the '+' (plus) symbol that appears in the top line of Test Explorer mean?**
30+
Real-time test discovery improves responsiveness, but it still allows you to get complete and precise results after a build.
3131

32-
The '+' (plus) symbol indicates that more tests may be discovered after a build when assembly-based discovery runs. This symbol appears if dynamically defined tests are detected in your project.
32+
## Test Explorer plus (+) symbol
3333

34-
![Plus symbol summary line](media/testex-plussymbol.png)
34+
**What does the plus symbol that appears in the top line of Test Explorer mean?**
35+
36+
The plus (+) symbol indicates that more tests might be discovered after a build when assembly-based discovery runs. This symbol appears if dynamically defined tests are detected in your project.
37+
38+
![Screenshot that shows a summary line with a plus symbol.](media/testex-plussymbol.png)
3539

3640
## Real-time test discovery
3741

38-
**Tests now appear in Test Explorer while I type, without having to build my project. What changed?**
42+
**Tests now appear in Test Explorer while I type, without requiring me to build my project. What changed?**
3943

40-
This feature is called [Real-time test discovery](https://devblogs.microsoft.com/dotnet/real-time-test-discovery/). It uses a Roslyn analyzer to find tests and populate Test Explorer in real time, without requiring you to build your project. For more information about test discovery behavior for dynamically defined tests such as theories or custom traits, see [Dynamic test discovery](#dynamic-test-discovery).
44+
This feature is called [real-time test discovery](https://devblogs.microsoft.com/dotnet/real-time-test-discovery/). It uses a Roslyn analyzer to find tests and populate Test Explorer in real time, without requiring you to build your project. For more information about test discovery behavior for dynamically defined tests such as theories or custom traits, see [Dynamic test discovery](#dynamic-test-discovery) earlier in this article.
4145

42-
## Real-time test discovery compatibility
46+
## Compatibility for real-time test discovery
4347

44-
**What languages and test frameworks can use Real Time Test Discovery?**
48+
**What languages and test frameworks can use real-time test discovery?**
4549

46-
[Real-time test discovery](https://devblogs.microsoft.com/dotnet/real-time-test-discovery/) only works for the managed languages (C# and Visual Basic), since it's built using the Roslyn compiler. For now, real-time test discovery only works for the xUnit, NUnit, and MSTest frameworks.
50+
[Real-time test discovery](https://devblogs.microsoft.com/dotnet/real-time-test-discovery/) works only for the managed languages (C# and Visual Basic), because it's built via the Roslyn compiler. For now, real-time test discovery works only for the xUnit, NUnit, and MSTest frameworks.
4751

4852
## Test Explorer logs
4953

50-
**How can I turn on logs for the Test Explorer?**
54+
**How can I turn on logs for Test Explorer?**
5155

52-
Navigate to **Tools** > **Options** > **Test** and find the Logging section there.
56+
Go to **Tools** > **Options** > **Test** and find the **Logging** section there.
5357

5458
## UWP test discovery
5559

5660
**Why are my tests in UWP projects not discovered until I deploy my app?**
5761

58-
UWP tests target a different runtime when the app is deployed. This means that to find tests accurately for UWP projects you not only need to build your project, but also deploy.
62+
Universal Windows Platform (UWP) tests target a different runtime when the app is deployed. To find tests accurately for UWP projects, you need to not only build your project but also deploy it.
5963

6064
## Test Explorer sorting
6165

6266
**How does sorting test results work in the hierarchy view?**
6367

64-
The hierarchy view sorts tests alphabetically as opposed to by outcome. Previous group by settings sorted test results by outcome and then alphabetically. You can still enable sorting by outcome by right-clicking on the column header in Test Explorer, enabling the State column, and then clicking on the State column header to apply sorting on that column. You can provide feedback about the design in this [GitHub issue](https://github.com/Microsoft/vstest/issues/1425).
68+
The hierarchy view sorts tests alphabetically, not by outcome. Previous group-by settings sorted test results by outcome and then alphabetically. You can still enable sorting by outcome by right-clicking the column header in Test Explorer, enabling the **State** column, and then selecting the **State** column header to apply sorting on that column. You can provide feedback about the design in [this GitHub issue](https://github.com/Microsoft/vstest/issues/1425).
6569

6670
## Test Explorer hierarchy view
6771

68-
**In the hierarchy view, there are passed, failed, skipped, and not run icons next to parent-node groupings. What do these icons mean?**
72+
**In the hierarchy view, there are passed, failed, skipped, and not-run icons next to parent-node groupings. What do these icons mean?**
6973

70-
The icons next to the Project, Namespace, and Class groupings show the state of the tests within that grouping. See the following table.
74+
The icons next to the **Project**, **Namespace**, and **Class** groupings show the state of the tests within that grouping. See the following table.
7175

72-
![Test Explorer Hierarchy Icons](media/testex-hierarchy-icons.png)
76+
![Table of Test Explorer hierarchy icons.](media/testex-hierarchy-icons.png)
7377

7478
## Search by file path
7579

76-
**There is no longer a "File Path" filter in the Test Explorer search box.**
80+
**Why is there is no longer a file path filter in the Test Explorer search box?**
7781

78-
The file path filter in the **Test Explorer** search box was removed in Visual Studio 2017 version 15.7. This feature had low usage, and Test Explorer can retrieve test methods faster by leaving out this feature. If this change interrupts your development flow, let us know by submitting feedback on [Developer Community](https://aka.ms/feedback/suggest?space=8).
82+
The file path filter in the Test Explorer search box was removed in Visual Studio 2017 version 15.7. This feature had low usage, and Test Explorer can retrieve test methods faster by leaving it out. If this change interrupts your development flow, let us know by submitting feedback on [Developer Community](https://aka.ms/feedback/suggest?space=8).
7983

80-
## Remove undocumented interfaces
84+
## Removal of undocumented interfaces
8185

8286
**Some test-related APIs are no longer present in Visual Studio 2019. What changed?**
8387

84-
In Visual Studio 2019, some test window APIs that were previously marked public but were never officially documented will be removed. They were marked as "deprecated" in Visual Studio 2017 to give extension maintainers an early warning. To our knowledge, very few extensions had found these APIs and taken a dependency on them. These include `IGroupByProvider`, `IGroupByProvider<T>`, `KeyComparer`, `ISearchFilter`, `ISearchFilterToken`, `ISearchToken`, and `SearchFilterTokenType`. If this change affects your extension, let us know by filing a bug on [Developer Community](https://aka.ms/feedback/suggest?space=8).
88+
In Visual Studio 2019, some test window APIs that were previously marked public but were never officially documented were removed. They were marked as deprecated in Visual Studio 2017 to give extension maintainers an early warning. To our knowledge, very few extensions found these APIs and took a dependency on them. They include `IGroupByProvider`, `IGroupByProvider<T>`, `KeyComparer`, `ISearchFilter`, `ISearchFilterToken`, `ISearchToken`, and `SearchFilterTokenType`.
89+
90+
If this change affects your extension, let us know by filing a bug on [Developer Community](https://aka.ms/feedback/suggest?space=8).
8591

8692
## Test adapter NuGet reference
8793

88-
**In Visual Studio 2017 version 15.8 my tests are discovered, but don't execute.**
94+
**Why don't my tests run in Visual Studio 2017 version 15.8, even though they're discovered?**
8995

90-
All test projects must include their .NET test adapter NuGet reference in their .csproj file. If they don't, the following test output appears on the project if discovery by a test adapter extension is kicked off after a build, or if the user tries to run the selected tests:
96+
All test projects must include their .NET test adapter NuGet reference in their .csproj file. If they don't, the following test output appears on the project if discovery by a test adapter extension starts after a build, or if the user tries to run the selected tests:
9197

9298
**Test project {} does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project. It is recommended to reference NuGet test adapters in each .NET test project in the solution.**
9399

94-
Instead of using test adapter extensions, projects are required to use test adapter NuGet packages. This requirement greatly improves performance and causes fewer issues with continuous integration. Read more about .NET Test Adapter Extension deprecation in the [release notes](/visualstudio/releasenotes/vs2017-relnotes-v15.8#testadapterextension).
100+
Instead of using test adapter extensions, projects are required to use test adapter NuGet packages. This requirement greatly improves performance and causes fewer problems with continuous integration. Read more about the deprecation of .NET test adapter extensions in the [release notes](/visualstudio/releasenotes/vs2017-relnotes-v15.8#testadapterextension).
95101

96-
## UWP TestContainer was not found
102+
## UWP TestContainer not found
97103

98-
**My UWP tests are no longer being executed in Visual Studio 2017 version 15.7 and later.**
104+
**Why are my UWP tests no longer running in Visual Studio 2017 version 15.7 and later?**
99105

100-
Recent UWP test projects specify a test platform build property that allows better performance for identifying test apps. If you have a UWP test project that was initialized before Visual Studio version 15.7, you may see this error in **Output** > **Tests**:
106+
Recent UWP test projects specify a build property that allows better performance for identifying test apps. If you have a UWP test project that was initialized before Visual Studio version 15.7, you might see this error in **Output** > **Tests**:
101107

102108
**System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: The following TestContainer was not found {} at Microsoft.VisualStudio.TestWindow.Controller.TestContainerProvider \<GetTestContainerAsync>d__61.MoveNext()**
103109

104110
To fix this error:
105111

106-
- Update your test project build property using the following code:
112+
- Update the build property for your test projects by using the following code:
113+
114+
```XML
115+
<UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">$(VisualStudioVersion)</UnitTestPlatformVersion>
116+
```
107117

108-
```XML
109-
<UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">$(VisualStudioVersion)</UnitTestPlatformVersion>
110-
```
118+
- Update the TestPlatform SDK version by using the following code:
111119

112-
- Update the TestPlatform SDK version using the following code:
120+
```XML
121+
<SDKReference Include="TestPlatform.Universal, Version=$(UnitTestPlatformVersion)" />
122+
```
113123

114-
```XML
115-
<SDKReference Include="TestPlatform.Universal, Version=$(UnitTestPlatformVersion)" />
116-
```
124+
## Preview features
117125

118-
## Using preview features
126+
**How can I use preview features in Visual Studio 2019?**
119127

120-
In Visual Studio 2019, you can opt into preview features in **Tools > Options > Environment > Preview Features**.
128+
In Visual Studio 2019, you can opt in to preview features in **Tools** > **Options** > **Environment** > **Preview Features**.
121129

122130
## Related content
123131

124132
- <xref:Microsoft.VisualStudio.TestTools.UnitTesting?displayProperty=fullName>
125133
- [Create and run unit tests for existing code](/previous-versions/dd293546(v=vs.110))
126134
- [Unit test your code](unit-test-your-code.md)
127-
- [Live unit testing FAQ](live-unit-testing-faq.yml)
135+
- [FAQ for live unit testing](live-unit-testing-faq.yml)

0 commit comments

Comments
 (0)