How to exclude a method using excludebyfile in OpenCover

Viewed 750

I'm using AxoCover, which uses OpenCover to generate reports.

The OpenCover usage for excludebyfile is

-excludebyfile:<filter>[;<filter>][;<filter>] - Exclude a class (or methods) by filter(s) that match the filenames. An * can be used as a wildcard.

I want to exclude the Dispose method in my controllers without having to decorate them all with the ExcludeFromCodeCoverage attribute, therefore I am intrigued by the (or methods) part of the usage.

I have tried:

  • Dispose - still included (I didn't really think that would work, but it was worth a try)
  • *Dispose* - still included
  • *.Dispose* - still included
  • *Controller.Dispose* - still included
  • *.cs*Dispose* - still included

I tried using the syntax for -filter e.g. -[*]*.Dispose*, but the tests failed to run.

Note that AxoCover doesn't allow the editing of the -filter argument or I would have tried using that approach.

What is the syntax for excluding methods using the excludebyfile argument?

0 Answers
Related