vendredi 26 juin 2020

How can I provide custom Application class for Unit Test in Android Project

I need a context in some unit test classes. I'm getting errors from 3rd SDKs when I try to provide an application class. So, I want to provide an empty application class for the unit tests.

@RunWith(RobolectricTestRunner::class)
class SampleTest {

    private val context: Context = ApplicationProvider.getApplicationContext()

Aucun commentaire:

Enregistrer un commentaire