Tudor Luca
05/21/2021, 12:33 PMdata class MyObject(val value: Int)
and 10 objects in memory I want to generate a data.kt
file like :
val obj1 = MyObject(value = 1)
val obj2 = MyObject(value = 12)
val obj3 = MyObject(value = 3)
etc
Context:
Jetpack Compose Previews cannot access the file system, so you'd need test data as Kotlin source code, you cannot use a JSON file and parse it, as you would do in a normal junit test. This would be useful as a JVM CLI companion tool when you want complex test data based on a server response that would be tedious to type by hand.
Thread in Slack Conversation