How do live visuals work code#
Live Unit Testing coverage visualization is updated immediately as you modify code in the code editor. There are three potential states for any given line:Ī line of executable code that is covered by at least one failing test is decorated with a red “x”.Ī line of executable code that is covered by only passing tests is decorated with a green “✓”.Ī line of executable code that is not covered by any test is decorated it with a blue dash “-” Unit test results and coverage visualizations appear on a line-by-line basis in the code editor. Once enabled, Live Unit Testing helps you quickly see whether the code you’re writing is covered and if the tests that cover it are passing without leaving the editor. View coverage information in the editor as you type Restart is the equivalent to selecting Stop and immediately selecting Start to start Live Unit Testing again.This is because it loses all data when it is stopped. When Live Unit Testing is started after it had been stopped, it takes longer to show the glyphs than when it was paused and resumed. Stop to completely stop Live Unit Testing.
How do live visuals work update#
Live Unit Testing will do the necessary work to catch up with all the edits that have been made while it was paused and will update the glyphs appropriately. When you are ready to resume, select Continue from the Live Unit Testing menu. When Live Unit Testing is paused, you do not see any coverage visualization in the editor, but all the data that is collected so far is preserved. It is as simple as opening the Test menu, selecting Live Unit Testing, and choosing one of the following options: To enable Live Unit Testing, go to the Test command of the top-level menu bar, choose “Live Unit Testing”, then “Start”:Īt any time, you can temporarily pause or completely stop Live Unit Testing for example, when you are in the middle of a refactoring, and you know that your tests will be broken for a while. Adaptable to work with three popular unit testing frameworks.Configurable with Tools/Options/Settings.Include/Exclude targeted test methods or projects for large solutions.Seamlessly debug failed test, edit and continue without having to restart.View coverage information in the editor as you type.The Live Unit Testing capabilities in Visual Studio 2017 Enterprise are highlighted below: It will also remind you when you need to write additional unit tests as you are making bug fixes and adding features. This will help you maintain quality by keeping the tests passing as you make changes.
This is a productivity feature, which provides real-time feedback directly in the editor on how code changes are impacting your unit tests and your code coverage. It also includes an updated video that demos all these capabilities.
In this blog, we focus on all capabilities including some that were not mentioned in the earlier blog. This is a more comprehensive blog than the one we published in November. Live Unit Testing is present in the Enterprise edition of Visual Studio 2017 and it’s available for C# and VB projects that target the.