This article is based on the sample source code project, available on samples browser. ReportGenerator converts coverage reports generated by Cobertura among many others, into human-readable reports in various formats. The report generation is possible using another open source project on GitHub - ReportGenerator. Coverlet collects Cobertura coverage test run data, which is used for report generation.Īdditionally, this article details how to use the code coverage information collected from a Coverlet test run to generate a report. Coverlet is an open source project on GitHub that provides a cross-platform code coverage framework for C#. ![]() While this article focuses on C# and xUnit as the test framework, both MSTest and NUnit would also work. This article discusses the usage of code coverage for unit testing with Coverlet and report generation using ReportGenerator. As an example, if you have a simple application with only two conditional branches of code ( branch a, and branch b), a unit test that verifies conditional branch a will report branch code coverage of 50%. Code coverage is a measurement of the amount of code that is run by unit tests - either lines, branches, or methods. Unit tests help to ensure functionality and provide a means of verification for refactoring efforts. If you already have a project, you can skip ahead to the Code coverage tooling section. ![]() This article explains the creation of the example project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |