I have setup an android test project that runs junit tests. It\'s using two eclipse projects \"Application\" and \"ApplicationTest\" where my tests are in the \"ApplicationT
With build tools 3.0.0 you can use ActivityTestRule
@RunWith(AndroidJUnit4::class)
@SmallTest
class MainActivityTest {
@Rule
@JvmField
var mainActivityRule = ActivityTestRule(MainActivity::class.java)
private val baseUrl: String
get() {
return mainActivityRule.activity.getString(R.string.base_url)
}
@Test
fun launchingWithMovieIntent() {
assert.that(baseUrl, equalTo("someValue")
}
}
}