Skip to content

Commit

Permalink
Add test for ParameterizedRobolectricTestRunner with Kotlin
Browse files Browse the repository at this point in the history
Signed-off-by: utzcoz <utzcoz@outlook.com>
  • Loading branch information
utzcoz committed Apr 12, 2023
1 parent 1f0b81f commit 6d49fde
Showing 1 changed file with 28 additions and 0 deletions.
@@ -0,0 +1,28 @@
package org.robolectric.integrationtests.kotlin

import android.net.Uri
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.ParameterizedRobolectricTestRunner
import org.robolectric.ParameterizedRobolectricTestRunner.Parameters
import org.robolectric.annotation.Config

@RunWith(ParameterizedRobolectricTestRunner::class)
class ParameterizedRobolectricTestRunnerTest(private var uri: Uri) {
@Test
@Config(manifest = Config.NONE)
fun parse() {
val currentUri = Uri.parse("http://host/")
assertThat(currentUri).isEqualTo(uri)
}

companion object {
@Parameters
@JvmStatic
fun getTestData(): Collection<*> {
val data = arrayOf<Any>(Uri.parse("http://host/"))
return listOf(data)
}
}
}

0 comments on commit 6d49fde

Please sign in to comment.