I just came by your library, and it's pretty awesome !
I ran into a breaking issue using the library : when the data class constructor is private, the following issue is raised :
Cannot access '<init>': it is private in <ClassName>
I have a data class like this :
data class Model (
val someInstant: kotlinx.datetime.Instant
)
When trying to use in tests :
@UsesFakes(Model::class)
class ModelTests : TestsWithMocks(){
override fun setUpMocks() = injectMocks(mocker)
@Fake
lateinit var model: Model
...
}
It generates something like this :
internal fun fakeInstant() = Instant()
The problem is that Instant has private constructor.
Is there any way to add a default way to create fakes ?
Dear MocKMP team,
I just came by your library, and it's pretty awesome ! I ran into a breaking issue using the library : when the data class constructor is private, the following issue is raised :
Cannot access '<init>': it is private in <ClassName>
I have a data class like this :
When trying to use in tests :
It generates something like this :
The problem is that
Instant
has private constructor.Is there any way to add a default way to create fakes ?
Thank you !