I would like to exclude some namespaces from my test coverage statistics. We're using xml for our dotcover configuration.
For example, we exclude our test projects this way:
<Filters>
<ExcludeFilters>
<FilterEntry>
<ModuleMask>*Tests</ModuleMask>
</FilterEntry>
</ExcludeFilters>
</Filters>
But I can't figure out how to do it for a C# namespace.
Well, you can use a ClassMask
, if you don't mind "sub-namespaces" being excluded too. Suppose you want to expose Foo.Bar
, you could have:
<FilterEntry>
<ClassMask>Foo.Bar.*</ClassMask>
</FilterEntry>
If you do have "sub-namespaces" you could probably use IncludeFilters
to explicitly include them again, although I haven't tried that.
See more on this question at Stackoverflow