https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
e

edenman

10/07/2020, 6:31 PM
I’ve got a “resources” abstraction in my KMP library that uses expect/actual declarations to do the actual work of “get the localized string” and “build a color value from HSL/RGB” etc. Works pretty well. I’m trying to add some unit tests for this code and running into the limitation of expect/actual (that you can’t swap it out for a dummy impl in tests). What do other people do for this sort of thing? Use an interface instead?
I guess I can put robolectric in my kmp-android module and run them that way, but i’ve been trying to avoid doing that
k

Kris Wong

10/07/2020, 6:38 PM
DI + interfaces
👍 1
AKA fakes
9 Views