How to test class using content resolver/provider?

前端 未结 4 1908
一向
一向 2021-02-04 12:44

I\'m trying to test class that queries content resolver.

I would like to use MockContentResolver and mock query method.

The problem is

4条回答
  •  时光说笑
    2021-02-04 13:14

    After reading docs I was able to write MockContentProvider that implemented return of appropriate cursors. Then I added this provider to MockContentResolver using addProvider.

提交回复
热议问题