Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
Source: Fine Code Coverage – Visual Studio Marketplace
Usage:
- Install
- Open the Fine Code Coverage window
- Run all unit tests
- See stats in Fine Code Coverage window
- Exclude the test project itself from coverage calculation:
(Below excludes project that ends with .Test and all its types (*
Pattern: [assemblyname]type
Filter Expressions:
Wildcards
* => matches zero or more characters
Examples
[*]* => All types in all assemblies (nothing is instrumented)
[coverlet.*]Coverlet.Core.Coverage => The Coverage class in the Coverlet.Core namespace belonging to any assembly that matches coverlet.* (e.g coverlet.core)
[*]Coverlet.Core.Instrumentation.* => All types belonging to Coverlet.Core.Instrumentation namespace in any assembly
[coverlet.*.tests]* => All types in any assembly starting with coverlet. and ending with .tests
Both 'Exclude' and 'Include' options can be used together but 'Exclude' takes precedence.