Skip a parameter in MockK unit test, Kotlin

I use MockK library for unit testing. Tested method contains strings that don’t have meaning for a result. I want to check other variables, but have to define a behaviour of strings because they are used in tested methods. For instance, every { resources.getQuantityString(R.plurals.age, 10, 10) } returns "10 years" every { resources.getString( R.string.surname, "surname"… Read More Skip a parameter in MockK unit test, Kotlin

Cannot Capture Mutable List Mockk

Kotlin error when compiling such code mentioned in https://mockk.io/#capturing. What’s wrong actually? class Foo{ fun fx(parm: MutableList<Double>) {} } val foo = Foo() val parm: MutableList<Double> = mutableListOf() every { foo.fx(capture(parm)) } Error written below Kotlin: Type mismatch: inferred type is Double but MutableList<Double> was expected >Solution : The capture function expects either a Slot… Read More Cannot Capture Mutable List Mockk