mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Show media details fragment when on clicking image of Peer Review (#4374)
* * show MediaDetailFragment in ReviewActivity on image click * Add javadoc * Reformated code of ReviewActivity xml * fix typos * add unit test * made minor changes
This commit is contained in:
parent
e9069d060c
commit
0c8b92c7aa
4 changed files with 189 additions and 97 deletions
|
|
@ -19,6 +19,7 @@ import org.robolectric.annotation.Config
|
|||
import org.robolectric.fakes.RoboMenu
|
||||
import org.robolectric.fakes.RoboMenuItem
|
||||
import org.wikipedia.AppAdapter
|
||||
import java.lang.reflect.Method
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [21], application = TestCommonsApplication::class)
|
||||
|
|
@ -101,4 +102,28 @@ class ReviewActivityTest {
|
|||
activity.onOptionsItemSelected(menuItem)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testSetUpMediaDetailFragment() {
|
||||
var setUpMediaDetailFragment: Method =
|
||||
ReviewActivity::class.java.getDeclaredMethod("setUpMediaDetailFragment")
|
||||
setUpMediaDetailFragment.isAccessible = true
|
||||
setUpMediaDetailFragment.invoke(activity)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testSetUpMediaDetailOnOrientation() {
|
||||
var setUpMediaDetailFragment: Method =
|
||||
ReviewActivity::class.java.getDeclaredMethod("setUpMediaDetailOnOrientation")
|
||||
setUpMediaDetailFragment.isAccessible = true
|
||||
setUpMediaDetailFragment.invoke(activity)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testOnBackPressed() {
|
||||
activity.onBackPressed()
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue