5

I am using Dagger 2 library to mock dependencies. While running unit test cases with code coverage it considers these generated dependencies and not the classes used for class under the question.

Is it possible to exclude these classes?

What I tried

Run -> Edit config -> Test coverage -> Exclude Package Individually adding generated class files, but it doesn't work

Any help here?

hardik9850
  • 581
  • 1
  • 9
  • 26
  • Possible duplicate of [How to exclude Dagger2 classes from test coverage](https://stackoverflow.com/questions/42575867/how-to-exclude-dagger2-classes-from-test-coverage) – David Rawson Jun 13 '18 at 01:44
  • went there, doesn't help – hardik9850 Sep 03 '18 at 07:43
  • 3
    In Android Studio 3.5 with IntelliJ coverage measurement, I was able to exclude `_Factory` and `_MembersInjector` classes individually by following your directions, locating the real class name in the package structure, and then double-clicking on its list item to edit the class names to include `_Factory` or `_MembersInjector`. I tried wildcards `*` and `\*`, but they did not work. I've filed a [ticket](https://issuetracker.google.com/issues/143160148) on Android Studio. – Ari Lacenski Oct 22 '19 at 20:59

0 Answers0