2

I have to test android application written in Kotlin. I tried

@RunWith(RobolectricTestRunner::class)
    public class GeoWindowTest {
  
    @RunWith(Parameterized::class)
    class TestParameterizedGeoWindow {}

} 

but it doesnt work. Im looking if there is another solutions to use these two runners. Also I could have used Junit5 but then Roboelectric is not compatible yet with Junit5

1 Answer 1

2

Robolectric has support for this, as described in this blog post.

@RunWith(ParameterizedRobolectricTestRunner::class)
class GeoWindowTest(private val param1: String, private val param2: Int) {
    companion object {
        @JvmStatic
        @ParameterizedRobolectricTestRunner.Parameters
        fun data() = listOf(
            arrayOf("Input 1", 4),
            arrayOf("Input 2", 7)
        )
    }  
} 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.