Answer the question
In order to leave comments, you need to log in
Wrong number of arguments, parameterized junit test, what's wrong?
@RunWith(Parameterized::class)
class TestNew(var list:List<Int>,var i:Int, var result:List<Int>){
companion object{
@JvmStatic
@Parameterized.Parameters
fun arrays()= listOf(listOf(listOf(1,2,3,4,5,6,7,8,9),3, listOf(4,6,8)))
}
//ТЕСТИРУЕМЫЙ МЕТОД
fun evenNumbers(array: List<Int>, number: Int): List<Int> {
val newarray=array.filter { it%2==0 }
val newarray2= newarray.drop(newarray.size-number)
return newarray2
}
@Test
fun makeTest(){
val actualResult=evenNumbers(list,i)
assertEquals(result,actualResult)
}
}
Answer the question
In order to leave comments, you need to log in
you need to replace fun arrays()= listOf(listOf(listOf(1,2,3,4,5,6,7,8,9),3, listOf(4,6,8))) with fun arrays()= arrayOf(listOf(listOf(1,2,3,4,5,6,7,8,9),3, listOf(4,6,8)))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question