{"id":450,"date":"2023-08-24T04:05:46","date_gmt":"2023-08-24T04:05:46","guid":{"rendered":"https:\/\/vihoth.com\/jetbrains\/?p=450"},"modified":"2023-08-24T04:12:27","modified_gmt":"2023-08-24T04:12:27","slug":"dotcover","status":"publish","type":"post","link":"https:\/\/vihoth.com\/jetbrains\/en\/dotcover\/","title":{"rendered":"dotCover"},"content":{"rendered":"<h2><span style=\"color: #c0c0c0;\">dotCover Features<\/span><\/h2>\n<p>dotCover is a .NET unit testing and code coverage tool that works right in Visual Studio and in JetBrains Rider, helps you know to what extent your code is covered with unit tests, provides great ways to visualize code coverage, and is Continuous Integration ready. dotCover calculates and reports statement-level code coverage in applications targeting .NET Framework, .NET Core, Mono, and Mono for Unity.<\/p>\n<h3><span style=\"color: #c0c0c0;\">Integration with Visual Studio and JetBrains Rider<\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-451 size-full\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover.jpg\" alt=\"\" width=\"598\" height=\"301\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover.jpg 598w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-300x151.jpg 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/p>\n<p>dotCover is a plugin to Visual Studio and JetBrains Rider, giving you the advantage of analyzing and visualizing code coverage without leaving the code editor. This includes running unit tests and analyzing coverage results right in the IDEs, as well as support for different color themes, new icons and menus.<\/p>\n<p>dotCover supports Visual Studio 2010 \u2014 2019 and JetBrains Rider 2018.2 or later.<\/p>\n<h3><span style=\"color: #c0c0c0;\">Works on Windows, macOS, and Linux<\/span><\/h3>\n<figure id=\"attachment_452\" aria-describedby=\"caption-attachment-452\" style=\"width: 1020px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-452 size-large\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-1-1024x501.jpg\" alt=\"Works on Windows, macOS, and Linux\" width=\"1020\" height=\"499\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-1-1024x501.jpg 1024w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-1-300x147.jpg 300w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-1-768x376.jpg 768w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-1.jpg 1203w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/><figcaption id=\"caption-attachment-452\" class=\"wp-caption-text\">Works on Windows, macOS, and Linux<\/figcaption><\/figure>\n<p>As a part of Visual Studio or JetBrains Rider on Windows, dotCover supports projects targeting .NET Framework 1.0 \u2013 4.7, and .NET Core 1.0 \u2013 3.0. On macOS and Linux, dotCover can be used only as a part of JetBrains Rider for analyzing code coverage in projects targeting .NET Core 1.0 \u2013 3.0, Mono 5.10 and later, and Mono for Unity 2018.3 and later.<\/p>\n<h3><span style=\"color: #c0c0c0;\">Running and managing unit tests<\/span><\/h3>\n<figure id=\"attachment_453\" aria-describedby=\"caption-attachment-453\" style=\"width: 788px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-453 size-full\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-2.jpg\" alt=\"Running and managing unit tests\" width=\"788\" height=\"577\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-2.jpg 788w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-2-300x220.jpg 300w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-2-768x562.jpg 768w\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" \/><figcaption id=\"caption-attachment-453\" class=\"wp-caption-text\">Running and managing unit tests<\/figcaption><\/figure>\n<p>dotCover comes bundled with a unit test runner that it shares with another JetBrains tool for .NET developers, ReSharper.<\/p>\n<p>The runner works in Visual Studio \/ JetBrains Rider, allows managing unit tests through sessions, and supports multiple unit testing frameworks, namely MSTest, NUnit, xUnit (all out of the box) and MSpec (via a plugin).<\/p>\n<h3><span style=\"color: #c0c0c0;\">Continuous testing<\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-454 size-full\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-3.jpg\" alt=\"\" width=\"597\" height=\"300\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-3.jpg 597w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-3-300x151.jpg 300w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/p>\n<p>dotCover supports continuous testing: a modern unit testing workflow whereby dotCover figures out on-the-fly which unit tests are affected by your latest code changes, and automatically re-runs the affected tests for you.Based on your preferences, dotCover can run affected tests on saving a file, on building your solution or soon as you explicitly tell dotCover to do so.<\/p>\n<p>The continuous testing mode can be switched on for any unit test session: this way you can choose which tests you want to run continuously and which to run in a traditional way.<\/p>\n<h3><span style=\"color: #c0c0c0;\">Unit test coverage<\/span><\/h3>\n<figure id=\"attachment_455\" aria-describedby=\"caption-attachment-455\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-455 size-full\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-4.jpg\" alt=\"dotCover\" width=\"600\" height=\"299\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-4.jpg 600w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-4-300x150.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-455\" class=\"wp-caption-text\">dotCover<\/figcaption><\/figure>\n<p>A major use case of dotCover is analyzing unit test coverage \u2014 that is, finding out which parts of application business logic are covered with unit tests, and which are not.<\/p>\n<p>Along with unit test run results, dotCover displays a coverage tree showing how thoroughly a particular project, namespace, type, or type member is covered with unit tests.<\/p>\n<h3><span style=\"color: #c0c0c0;\">Coverage highlighting in Visual Studio and JetBrains Rider<\/span><\/h3>\n<figure id=\"attachment_457\" aria-describedby=\"caption-attachment-457\" style=\"width: 449px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-457 size-full\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-6.jpg\" alt=\"Coverage highlighting in Visual Studio and JetBrains Rider\" width=\"449\" height=\"269\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-6.jpg 449w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-6-300x180.jpg 300w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><figcaption id=\"caption-attachment-457\" class=\"wp-caption-text\">Coverage highlighting in Visual Studio and JetBrains Rider<\/figcaption><\/figure>\n<p>To visualize coverage data, dotCover can highlight lines of code right in the code editor. There&#8217;s an option to switch between highlighting markers and colored background or to display both.<\/p>\n<p>Note that highlighting shows not only covered and uncovered code but the results of the covering unit tests as well. Green color means that tests pass while red color indicates that at least one test that covers the statement fails. Grey color shows uncovered code.<\/p>\n<p>Coverage highlighting in Visual Studio and JetBrains Rider<\/p>\n<h3><span style=\"color: #c0c0c0;\">Navigation to covering tests<\/span><\/h3>\n<figure id=\"attachment_459\" aria-describedby=\"caption-attachment-459\" style=\"width: 598px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-459 size-full\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-7.jpg\" alt=\"Navigation to covering tests\" width=\"598\" height=\"298\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-7.jpg 598w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-7-300x149.jpg 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><figcaption id=\"caption-attachment-459\" class=\"wp-caption-text\">Navigation to covering tests<\/figcaption><\/figure>\n<p>dotCover provides a command (and a keyboard shortcut) to detect which tests cover a particular location in code, be it a class, method, or property.<\/p>\n<p>You can invoke the command from Visual Studio text editor or from dotCover&#8217;s Coverage Tree view.<\/p>\n<p>You can navigate from a pop-up that lists covering tests to any of these tests. Additionally, you can instantly run them or add to an existing unit test session.<\/p>\n<h3><span style=\"color: #c0c0c0;\">Hot Spots view<\/span><\/h3>\n<figure id=\"attachment_460\" aria-describedby=\"caption-attachment-460\" style=\"width: 998px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-460 size-full\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-8.jpg\" alt=\"dotCover\" width=\"998\" height=\"620\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-8.jpg 998w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-8-300x186.jpg 300w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-8-768x477.jpg 768w\" sizes=\"auto, (max-width: 998px) 100vw, 998px\" \/><figcaption id=\"caption-attachment-460\" class=\"wp-caption-text\">dotCover<\/figcaption><\/figure>\n<p>The Hot Spots view was designed to help you identify the most risky methods in your solution. Hot Spots are calculated in terms of high cyclomatic complexity and low unit test coverage of the methods.<\/p>\n<h3><span style=\"color: #c0c0c0;\">Coverage filters<\/span><\/h3>\n<figure id=\"attachment_461\" aria-describedby=\"caption-attachment-461\" style=\"width: 598px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-461 size-full\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-9.jpg\" alt=\"Coverage filters\" width=\"598\" height=\"300\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-9.jpg 598w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-9-300x151.jpg 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><figcaption id=\"caption-attachment-461\" class=\"wp-caption-text\">Coverage filters<\/figcaption><\/figure>\n<p>Sometimes, you don&#8217;t want to know coverage data solution-wide. For example, you may not be interested in coverage statistics for code marked with ObsoleteAttribute or a specific legacy project.<\/p>\n<p>In this case you can set global or solution-specific coverage filters based on project, namespace, type, or type member names. Attribute filters are also available that restrict gathering coverage information to code marked (or not marked) with certain attributes.<\/p>\n<h3><span style=\"color: #c0c0c0;\">Excluding nodes from coverage tree<\/span><\/h3>\n<figure id=\"attachment_462\" aria-describedby=\"caption-attachment-462\" style=\"width: 593px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-462 size-full\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-10.jpg\" alt=\"Excluding nodes from coverage tree\" width=\"593\" height=\"300\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-10.jpg 593w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-10-300x152.jpg 300w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><figcaption id=\"caption-attachment-462\" class=\"wp-caption-text\">Excluding nodes from coverage tree<\/figcaption><\/figure>\n<p>As an alternative to filters that you set up in advance or that you apply to any solutions you open, you can exclude items from coverage results as you work with them.<\/p>\n<p>When you already have coverage data collected, you can choose to exclude a specific node from the coverage tree (and optionally create a permanent coverage filter). As soon as you do this, dotCover will instantly recalculate coverage statistics.<\/p>\n<h3><span style=\"color: #c0c0c0;\">Multiple report formats<\/span><\/h3>\n<figure id=\"attachment_463\" aria-describedby=\"caption-attachment-463\" style=\"width: 1020px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-463 size-large\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-11-1024x507.jpg\" alt=\"Multiple report formats\" width=\"1020\" height=\"505\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-11-1024x507.jpg 1024w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-11-300x148.jpg 300w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-11-768x380.jpg 768w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-11.jpg 1071w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/><figcaption id=\"caption-attachment-463\" class=\"wp-caption-text\">Multiple report formats<\/figcaption><\/figure>\n<p>dotCover helps process coverage data the way you need.<\/p>\n<p>Exporting to several formats, including HTML, XML, JSON, and XML for NDepend enables you to share coverage reports with the rest of the team or pass coverage information to external services.<\/p>\n<h3><span style=\"color: #c0c0c0;\">Code coverage for manual testing<\/span><\/h3>\n<figure id=\"attachment_464\" aria-describedby=\"caption-attachment-464\" style=\"width: 596px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-464 size-full\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-12.jpg\" alt=\"Code coverage for manual testing\" width=\"596\" height=\"299\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-12.jpg 596w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-12-300x151.jpg 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><figcaption id=\"caption-attachment-464\" class=\"wp-caption-text\">Code coverage for manual testing<\/figcaption><\/figure>\n<p>As an alternative to unit test coverage, dotCover can run coverage analysis upon .NET applications executed from Visual Studio.<\/p>\n<p>This enables a QA engineer to execute a use-case scenario and examine what parts of the code where actually executed during this use-case. Saving and merging coverage snapshots supports executing non-trivial test cases.<\/p>\n<h3><span style=\"color: #c0c0c0;\">Coverage analysis as part of Continuous Integration<\/span><\/h3>\n<figure id=\"attachment_465\" aria-describedby=\"caption-attachment-465\" style=\"width: 1020px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-465 size-large\" src=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-13-1024x458.jpg\" alt=\"Coverage analysis as part of Continuous Integration\" width=\"1020\" height=\"456\" srcset=\"https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-13-1024x458.jpg 1024w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-13-300x134.jpg 300w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-13-768x344.jpg 768w, https:\/\/vihoth.com\/jetbrains\/wp-content\/uploads\/2023\/08\/dotCover-13.jpg 1090w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/><figcaption id=\"caption-attachment-465\" class=\"wp-caption-text\">Coverage analysis as part of Continuous Integration<\/figcaption><\/figure>\n<p>dotCover is a great fit with Continuous Integration servers, most prominently JetBrains&#8217; own product, TeamCity.<\/p>\n<p>First of all, via TeamCity add-in to Visual Studio, dotCover is able to obtain coverage data from a TeamCity server \u2014 without running coverage analysis on a local machine.<\/p>\n<p>On the other hand, dotCover coverage analysis engine is bundled with into a free version of TeamCity, which helps schedule coverage runs as part of Continuous Integration process and generate server-side coverage reports. TeamCity understands the output of dotCover console runner and highlights its errors and warnings in the build log.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>dotCover Features dotCover is a .NET unit testing and code coverage tool that works right in Visual Studio and in JetBrains Rider, helps you know to what extent your code is covered with unit tests, provides great ways to visualize code coverage, and is Continuous Integration ready. dotCover calculates and reports statement-level code coverage in [&#8230;]\n","protected":false},"author":3,"featured_media":467,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-450","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jetbrains-en"],"_links":{"self":[{"href":"https:\/\/vihoth.com\/jetbrains\/wp-json\/wp\/v2\/posts\/450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vihoth.com\/jetbrains\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vihoth.com\/jetbrains\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vihoth.com\/jetbrains\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/vihoth.com\/jetbrains\/wp-json\/wp\/v2\/comments?post=450"}],"version-history":[{"count":3,"href":"https:\/\/vihoth.com\/jetbrains\/wp-json\/wp\/v2\/posts\/450\/revisions"}],"predecessor-version":[{"id":469,"href":"https:\/\/vihoth.com\/jetbrains\/wp-json\/wp\/v2\/posts\/450\/revisions\/469"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vihoth.com\/jetbrains\/wp-json\/wp\/v2\/media\/467"}],"wp:attachment":[{"href":"https:\/\/vihoth.com\/jetbrains\/wp-json\/wp\/v2\/media?parent=450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vihoth.com\/jetbrains\/wp-json\/wp\/v2\/categories?post=450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vihoth.com\/jetbrains\/wp-json\/wp\/v2\/tags?post=450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}