Exclude methods

Chip M
2009-04-28
2013-04-29
  • Chip M
    Chip M
    2009-04-28

    Hi, I was wondering if it is possible to exclude methods from reports?  I have some classes that have private methods that are GUI callbacks, such as when a user clicks a button, and want to exclude just those methods from coverage analysis.  Any suggestions?

    Thanks

     
    • Dan Ports
      Dan Ports
      2009-04-29

      Nope, it is not currently possible to include/exclude at the method level. The closest you can get would be to subscribe to the event with an anonymous delegate, and then exclude all anonymous delegates from the coverage report using a rule like:

      --exclude=attribute:System.Runtime.CompilerServices.CompilerGeneratedAttribute

      Note that if you want to use attribute-based rules, you'll need to build PartCover from the trunk or build it from the latest released version with this patch:
      http://sourceforge.net/tracker/?func=detail&aid=2018127&group_id=175733&atid=874420