Search code examples
c#.netunit-testingbatch-fileopencover

How to filter by several class name in opencover and report generator in bat


How to filter by several class name in opencover and report generator in bat file

It is necessary to receive only those classes in namespace

.AutomapperConfigurators. or ProjectName.BL.ServiceInteraction.*

for opencover

-filter:"+.AutomapperConfigurators.;+ProjectName.BL.ServiceInteraction*

for report generator

-classfilters:"+.AutomapperConfigurators.;+ProjectName.BL.ServiceInteraction]*

it doesn't work


Solution

  • for opencover you need to use the filters correctly.

    for the example given your filters should probably look like this

    -filter:"+[*]*.AutomapperConfigurators.* +[*]ProjectName.BL.ServiceInteraction.*"
    

    once the opencover filters are correct you don't need to apply [m]any reportgenerator filters.