4

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?

Mark_Gibson
  • 922
  • 1
  • 12
  • 32
  • I've the same problem. Did you find a solution for that? – Salatiel Mar 29 '19 at 19:05
  • Unfortunately not. I ended up using a couple of approaches. Move the functions into a partial class in a separate file and exclude that file, or simply write a test that called the method. – Mark_Gibson Apr 01 '19 at 07:57

0 Answers0