
For more information about test discovery behavior for dynamically defined tests such as theories or custom traits, see Dynamic test discovery.

It uses a Roslyn analyzer to find tests and populate Test Explorer in real time, without requiring you to build your project.

This feature is called Real-time test discovery. Tests now appear in Test Explorer while I type, without having to build my project. This symbol appears if dynamically defined tests are detected in your project. The '+' (plus) symbol indicates that more tests may be discovered after a build when assembly-based discovery runs. What does the '+' (plus) symbol that appears in the top line of Test Explorer mean? Real-time test discovery improves responsiveness, but still allows you to get complete and precise results after a build. 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. In Visual Studio 2017 version 15.6 and later, assembly-based discovery (the traditional discoverer) runs only after builds. A build is required for those tests to be accurately found. It can’t discover tests that use theories, custom adapters, custom traits, #ifdef statements, and more because they're defined at run time. Real-time test discovery is source-based test discovery. (For example, theories, custom adapters, custom traits, #ifdefs, etc.) How can I discover these tests?īuild your project to run assembly-based discovery. Test Explorer is not discovering my tests that are dynamically defined.

Applies to: Visual Studio Visual Studio for Mac Visual Studio Code Dynamic test discovery
