You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ide/find-code-changes-and-other-history-with-codelens.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,7 +200,7 @@ You can discover unit tests that exist for your C# or Visual Basic code without
200
200
201
201
1. Go to application code that has associated [unit test code](../test/unit-test-your-code.md).
202
202
203
-
2. If you have not already, build your application to load the CodeLens test indicators. Make sure [discovery by built assemblies](../test/test-explorer-faq.md#3-assembly-based-discovery-is-no-longer-working-for-my-project-how-do-i-turn-it-back-on) is turned on.
203
+
2. If you have not already, build your application to load the CodeLens test indicators. Make sure [discovery by built assemblies](../test/test-explorer-faq.md#assembly-based-discovery-is-no-longer-working-for-my-project-how-do-i-turn-it-back-on) is turned on.
204
204
205
205
3. Review the tests for the code by pressing **Alt**+**3**.
206
206
@@ -321,7 +321,7 @@ To use the keyboard:
321
321
322
322
### Q: My CodeLens test indicators no longer appear in my file when I first open my solution. How can I load them?
323
323
324
-
**A:** Rebuild your project to get CodeLens test indicators to load in your file. Make sure [discovery by built assemblies](../test/test-explorer-faq.md#3-assembly-based-discovery-is-no-longer-working-for-my-project-how-do-i-turn-it-back-on) is turned on. To improve performance, Visual Studio no longer fetches source information for test indicators when code files are loaded. Test indicators are loaded after a build, or when you navigate to a test by double-clicking on it in **Test Explorer**.
324
+
**A:** Rebuild your project to get CodeLens test indicators to load in your file. Make sure [discovery by built assemblies](../test/test-explorer-faq.md#assembly-based-discovery-is-no-longer-working-for-my-project-how-do-i-turn-it-back-on) is turned on. To improve performance, Visual Studio no longer fetches source information for test indicators when code files are loaded. Test indicators are loaded after a build, or when you navigate to a test by double-clicking on it in **Test Explorer**.
Copy file name to clipboardExpand all lines: docs/test/test-explorer-faq.md
+12-16Lines changed: 12 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,69 +19,65 @@ manager: douge
19
19
---
20
20
# Visual Studio Test Explorer FAQ
21
21
22
-
## Test discovery
23
-
24
-
### 1. The 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
+
## The 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?
25
23
26
24
Build your project and make sure assembly-based discovery is turned on in **Tools** > **Options** > **Test**.
27
25
28
26
[Real time test discovery](https://go.microsoft.com/fwlink/?linkid=862824) is source-based test discovery. It can’t discover tests that use theories, custom adapters, custom traits, `#ifdef` statements, etc. because they are defined at runtime. A build is required for those tests to be accurately discovered. In the 15.6 Previews, assembly-based discovery (the traditional discoverer) runs only after builds. This setting means Real Time Test Discovery discovers as many tests as it can while you are editing, and assembly-based discovery allows dynamically defined tests to appear after a build. Real Time Test Discovery improves responsiveness, but stills allow you to get complete and accurate results after a build.
29
27
30
-
### 2. What does the '+' (plus) symbol that appears in the top line of Test Explorer mean?
28
+
## What does the '+' (plus) symbol that appears in the top line of Test Explorer mean?
31
29
32
30
The '+' (plus) symbol indicates that more tests may be discovered after a build as long as assembly-based discovery is turned on. It appears if dynamically defined tests are detected in your project.
33
31
34
32

35
33
36
-
### 3. Assembly-based discovery is no longer working for my project. How do I turn it back on?
34
+
## Assembly-based discovery is no longer working for my project. How do I turn it back on?
37
35
38
36
Go to **Tools** > **Options** > **Test** and check the box for **Additionally discover tests from built assemblies after builds.**
### 4. Tests now appear in Test Explorer while I type, without having to build my project. What changed?
40
+
## Tests now appear in Test Explorer while I type, without having to build my project. What changed?
43
41
44
42
This feature is called [Real time test discovery](https://go.microsoft.com/fwlink/?linkid=862824). It uses a Roslyn analyzer to discover 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 FAQ #1 .
45
43
46
-
### 5. What languages and test frameworks can use Real Time Test Discovery?
44
+
## What languages and test frameworks can use Real Time Test Discovery?
47
45
48
46
[Real time test discovery](https://go.microsoft.com/fwlink/?linkid=862824) only works for the managed languages (C# and Visual Basic), since it is built using the Roslyn compiler. For now, Real Time Test Discovery only works for the xUnit, NUnit, and MSTest frameworks.
49
47
50
-
### 6. How can I turn on logs for the Test Explorer?
48
+
## How can I turn on logs for the Test Explorer?
51
49
52
50
Navigate to **Tools** > **Options** > **Test** and find the Logging section there.
53
51
54
-
### 7. Why are my tests in UWP projects not discovered until I deploy my app?
52
+
## Why are my tests in UWP projects not discovered until I deploy my app?
55
53
56
54
UWP tests target a different runtime when the app is deployed. This means that to discover tests accurately for UWP projects you not only need to build your project, but also deploy.
57
55
58
-
### 8. How does sorting test results work in the hierarchy view?
56
+
## How does sorting test results work in the hierarchy view?
59
57
60
58
The hierarchy view sorts tests alphabetically as opposed to by outcome. The other group by settings normally sort test results by outcome and then alphabetically. See the different group by options in the following image for comparison. You can provide feedback about the design [in this GitHub issue](https://github.com/Microsoft/vstest/issues/1425).
61
59
62
60

63
61
64
-
### 9. In the hierarchy view, there are passed, failed, skipped, and not run icons next to the Project, Namespace, and Class groupings. What do these icons mean?
62
+
## In the hierarchy view, there are passed, failed, skipped, and not run icons next to the Project, Namespace, and Class groupings. What do these icons mean?
65
63
66
64
The icons next to the Project, Namespace, and Class groupings reflect the state of the tests within that grouping. See the following table.
67
65
68
66

69
67
70
-
### 10. There is no longer a "File Path" filter in the Test Explorer search box.
68
+
## There is no longer a "File Path" filter in the Test Explorer search box.
71
69
72
70
The file path filter in the **Test Explorer** search box was removed in Visual Studio 2017 version 15.7 preview 3. This feature had low usage, and the Test Explorer can retrieve test methods faster by excluding this feature. If this change interrupts your development flow, please let us know by submitting feedback on [Developer Community](https://developercommunity.visualstudio.com/).
73
71
74
-
### 11. In Visual Studio 2017 version 15.8 my tests are discovered, but don't execute.
72
+
## In Visual Studio 2017 version 15.8 my tests are discovered, but don't execute.
75
73
76
74
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:
77
75
78
76
**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.**
79
77
80
78
Instead of using test adapter extensions, projects are required to use test adapter NuGet packages. This 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-preview-relnotes#testadapterextension).
81
79
82
-
## Features
83
-
84
-
### How can I turn on feature flags to try out new testing features?
80
+
## How can I turn on feature flags to try out new testing features?
85
81
86
82
Feature flags are used to ship experimental or unfinished parts of the product to avid users who would like to give feedback before the features ship officially. They may destabilize your IDE experience. Use them only in safe development environments, such as virtual machines. Feature flags are always use-at-your-own-risk settings. You can turn on experimental features with the [feature flags extension](https://marketplace.visualstudio.com/items?itemName=PaulHarrington.FeatureFlagsExtension), or through the developer command prompt.
0 commit comments