mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Extend About Activity Tests (#4168)
This commit is contained in:
parent
cd3ba67cfb
commit
9296ef6fbd
1 changed files with 8 additions and 4 deletions
|
|
@ -8,7 +8,6 @@ import org.junit.Assert
|
|||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.mockito.MockitoAnnotations
|
||||
import org.robolectric.Robolectric
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
|
|
@ -24,16 +23,15 @@ import org.robolectric.shadows.ShadowActivity
|
|||
@Config(sdk = [21], application = TestCommonsApplication::class)
|
||||
class AboutActivityUnitTests {
|
||||
|
||||
private lateinit var activity:AboutActivity
|
||||
private lateinit var activity: AboutActivity
|
||||
|
||||
@Mock
|
||||
private lateinit var context: Context
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
MockitoAnnotations.initMocks(this)
|
||||
|
||||
activity = Robolectric.buildActivity(AboutActivity::class.java).get()
|
||||
activity = Robolectric.buildActivity(AboutActivity::class.java).create().get()
|
||||
|
||||
context = RuntimeEnvironment.application.applicationContext
|
||||
}
|
||||
|
|
@ -107,4 +105,10 @@ class AboutActivityUnitTests {
|
|||
shadowActivity.clickMenuItem(R.id.share_app_icon)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testOnSupportNavigateUp() {
|
||||
activity.onSupportNavigateUp()
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue