FilePickerTest: fix failing unit test (#5237)

This commit is contained in:
Ritika Pahwa 2023-06-16 16:11:07 +05:30 committed by GitHub
parent 4cb3b0cfe9
commit 4a9101c614
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,7 @@ import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import org.robolectric.annotation.LooperMode
import java.lang.reflect.Method
import kotlin.random.Random.Default.nextBoolean
@RunWith(RobolectricTestRunner::class)
@Config(
@ -60,7 +61,7 @@ class FilePickerTest {
`when`(PreferenceManager.getDefaultSharedPreferences(activity)).thenReturn(sharedPref)
`when`(sharedPref.edit()).thenReturn(sharedPreferencesEditor)
`when`(sharedPref.edit().putInt("type", 0)).thenReturn(sharedPreferencesEditor)
FilePicker.openGallery(activity, 0)
FilePicker.openGallery(activity, 0, nextBoolean())
verify(activity).startActivityForResult(
ArgumentMatchers.anyObject(),
requestCodeCaptor?.capture()?.toInt()!!