open cover

OpenCover, an open source code coverage tool for .NET that I started in 2011.

    Search by
    open cover

    Excluding code from coverage...

    This may (no guarantees) turn into a series of posts on how to refactor your code for testing using simple examples. This particular example came from a request to add an "Exclude Lines from Coverage" feature to OpenCover [https://github.com/OpenCover/opencover]. Now there are many ways this could be achieved, none of which I had any appetite for as they were either too clunky and/or could make OpenCover very slow. I am also not a big fan on excluding anything from code coverage; though OpenCov

    open cover

    A simple TDD example

    I recently posted a response to StackOverflow wrt TDD and Coverage [http://stackoverflow.com/a/26152423/189163]and I thought it would be worth re-posting the response here. The example is simple but hopefully shows how writing the right tests using TDD gives you a better suite of tests for your code than you would probably write if you wrote the tests after the code (which may have been re-factored as you developed). "As the [original] accepted answer has pointed out your actual scenario reduce

    codeproject

    Getting code coverage from your .NET testing using OpenCover.

    Introduction OpenCover is a free, open-sourced [https://github.com/sawilde/opencover], code coverage tool for .NET 2.0 and above running on the .NET platform. It supports sequence coverage, branch coverage and has a cover by test facility. Though OpenCover is command line only, a rich HTML UI of the results can be visualized using ReportGenerator [http://reportgenerator.codeplex.com/]. We will aim to demonstrate how you can use this utility to get visibility into your testing coverage. Backgro