Tim*_*nin 6 android unit-testing intentservice android-testing android-espresso
如何IntentService在不使用弃用的情况下在android中测试ServiceTestCase?
从ServiceTestCase的文档:
此类在API级别24中已弃用.请改用ServiceTestRule.应使用Android测试支持库编写新测试.
但ServiceTestRule文档说它不支持IntentServices:
注意:此规则不支持IntentService,因为当onHandleIntent(android.content.Intent)完成所有未完成的命令时,它会自动销毁.因此无法保证及时建立成功的连接.
我该如何测试IntentService呢?
| 归档时间: |
|
| 查看次数: |
1729 次 |
| 最近记录: |