Robolectric not using test application

后端 未结 3 1844
抹茶落季
抹茶落季 2021-02-06 03:11

According to this link I can create a test application which Robolectric will automatically start using in tests. I cannot get this to work.

I am using Dagger for depen

3条回答
  •  甜味超标
    2021-02-06 03:53

    It's really simple in Robolectric 3.0, you add it directly to the @Config annotation.

    @RunWith(RobolectricGradleTestRunner.class)
    @Config(constants = BuildConfig.class, sdk = 21,application = TestApplication.class)
    public class ActivityTest {
    

提交回复
热议问题