

enables us to specify the application to calculate code coverage for. Alternatively, Control+Alt+K K or ReSharper | Cover | Cover Application. Hitting Control+Alt+K P or choosing ReSharper | Cover | Cover Startup Project in the menu launches our solution's startup project under dotCover control. After you click Hot Spots, it will show you a "cloud" of potentially risky classes: the classes that have high cyclomatic complexity but are poorly covered with tests.ĭotCover enables us to calculate code coverage for a specific use-case scenario. The Unit Test Coverage window contains one more very useful metric. īy default, coverage and test results are shown by markers in the left gutter of the editor: a marker is red if any tests related to the current statement are failing, green if all tests are passing, and grey if there are no tests covering this statement. Visualize code coverage by clicking Highlight code. If you want to see what tests exactly cover a particular class or method, select it in the Unit Test Coverage window and in the context menu choose Show Covering Tests. Coverage results (how tests cover particular classes and methods in your code) will be shown in the Unit Test Coverage tool window. Test results will be shown in real time in the newly opened Unit Test Sessions window. This will run a normal unit tests session but dotCover will collect coverage data in the background. Note that you can limit coverage scope by using coverage filters.Ĭlick Cover Unit Tests Control+T H. If you want to analyze all tests, select the top-level node in the tree. In the Unit Test Explorer window, select the tests whose coverage you want to analyze. Here you can take a look at how many tests are there in the solution. This will open the Unit Test Explorer tool window.

Analyze coverage of unit tests in a solutionĬhoose ReSharper | Unit Tests | Unit Tests from the main menu. The task is to understand how much of the code is covered. Baseline conditions are as follows: you have a solution opened in Visual Studio and code in the solution is covered with some unit tests. The most basic scenario of using dotCover is measuring how much of your code is actually executed when you run unit tests. From these menus, you can execute various commands available in dotCover. After installing dotCover with or without any other dotUltimate tools and opening Visual Studio, you will find dotCover commands under the ReSharper | Unit Tests and ReSharper | Cover in the main menu. By measuring method calls during unit tests or when running the application manually, dotCover shows us which statements were covered and which were not.ĭotCover integrates into Visual Studio 2010, 2012, 2013, 2015, 2017, 2019, and 2022. NET application code is actually being tested. dotCover lets us analyze how much of our. NET unit test runner and code coverage tool.
