Skip to content

Commit

Permalink
refactor: title test
Browse files Browse the repository at this point in the history
  • Loading branch information
criticalAY committed Dec 9, 2024
1 parent 9140852 commit 201191e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions AnkiDroid/src/androidTest/java/com/ichi2/anki/MultimediaTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class MultimediaTest : InstrumentedTest() {

@Test
fun testFragmentTitle() {
ActivityScenario.launch<MultimediaActivity>(intentBuilder(testContext)).use { scenario ->
withMultimediaActivityScenario { scenario ->
scenario.onActivity { activity ->
val fragment = activity.supportFragmentManager.findFragmentById(R.id.fragment_container) as MultimediaFragment
val titleString = title?.let { testContext.getString(it) }
Expand Down Expand Up @@ -102,16 +102,16 @@ class MultimediaTest : InstrumentedTest() {
get() = this.supportFragmentManager.findFragmentById(R.id.fragment_container)!!

companion object {
@Parameterized.Parameters(name = "{2}")
@Parameterized.Parameters(name = "{index}: {1}")
@JvmStatic
fun initParameters(): Collection<Array<out Any>> {
return listOf(
arrayOf({ context: Context -> getCameraFragment(context) }, R.string.multimedia_editor_popup_image, "Add image (Camera)"),
arrayOf({ context: Context -> getGalleryFragment(context) }, R.string.multimedia_editor_popup_image, "Add image (Gallery)"),
arrayOf({ context: Context -> getDrawingFragment(context) }, R.string.multimedia_editor_popup_image, "Add image (Drawing)"),
arrayOf({ context: Context -> getAudioFragment(context) }, R.string.multimedia_editor_popup_audio_clip, "Add audio clip"),
arrayOf({ context: Context -> getVideoFragment(context) }, R.string.multimedia_editor_popup_video_clip, "Add video clip"),
arrayOf({ context: Context -> getAudioRecordingFragment(context) }, R.string.multimedia_editor_field_editing_audio, "Record audio")
arrayOf({ context: Context -> getCameraFragment(context) }, R.string.multimedia_editor_popup_image),
arrayOf({ context: Context -> getGalleryFragment(context) }, R.string.multimedia_editor_popup_image),
arrayOf({ context: Context -> getDrawingFragment(context) }, R.string.multimedia_editor_popup_image),
arrayOf({ context: Context -> getAudioFragment(context) }, R.string.multimedia_editor_popup_audio_clip),
arrayOf({ context: Context -> getVideoFragment(context) }, R.string.multimedia_editor_popup_video_clip),
arrayOf({ context: Context -> getAudioRecordingFragment(context) }, R.string.multimedia_editor_field_editing_audio)
)
}

Expand Down

0 comments on commit 201191e

Please sign in to comment.