mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Fix test compilation by removing obsolete testSetImageToBeUploaded and adding tha testInitializeFragmentWithUploadItem (#6404)
This commit is contained in:
parent
4e70e4f91c
commit
29a8762a1c
1 changed files with 14 additions and 3 deletions
|
|
@ -162,9 +162,20 @@ class UploadMediaDetailFragmentUnitTest {
|
|||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testSetImageToBeUploaded() {
|
||||
fun testInitializeFragmentWithUploadItem() {
|
||||
Shadows.shadowOf(Looper.getMainLooper()).idle()
|
||||
fragment.setImageToBeUploaded(null, null, location)
|
||||
Whitebox.setInternalState(fragment, "presenter", presenter)
|
||||
Whitebox.setInternalState(fragment, "uploadItem", uploadItem)
|
||||
`when`(uploadItem.mediaUri).thenReturn(mediaUri)
|
||||
`when`(callback.getIndexInViewFlipper(fragment)).thenReturn(0)
|
||||
`when`(callback.totalNumberOfSteps).thenReturn(2)
|
||||
val method: Method =
|
||||
UploadMediaDetailFragment::class.java.getDeclaredMethod(
|
||||
"initializeFragment",
|
||||
)
|
||||
method.isAccessible = true
|
||||
method.invoke(fragment)
|
||||
Mockito.verify(presenter).onImageProcessed(uploadItem, 0)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -456,4 +467,4 @@ class UploadMediaDetailFragmentUnitTest {
|
|||
val shadowIntent: ShadowIntent = shadowOf(startedIntent)
|
||||
Assert.assertEquals(shadowIntent.intentClass, LocationPickerActivity::class.java)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue