Testing async tasks with robolectric

前端 未结 2 1111
无人共我
无人共我 2021-01-01 12:27

Do you know how to implement unit testing for AsyncTasks using Robolectric ? Any pointers will be appreciated.

2条回答
  •  难免孤独
    2021-01-01 12:58

    With Robolectric 2.4 this is now in ShadowApplication:

    ShadowApplication.runBackgroundTasks();

提交回复
热议问题