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

Napa Ram

06/28/2021, 9:52 AM
Hello Everyone, i completed My POC in KMM using Ktor, Realm and shared ViewModel, so now only UI need to take care in android and iOS. now i need to write the Unit Testing for Ktor, realm and shared viewmodel also, can anyone please share the blog or sample how we can write unit testing and do the mocking in kotlin multiplatform, Thanks to @John O'Reilly , i have done all these by learning from his blog's and sample code
👀 1
j

Javier

06/28/2021, 11:37 AM
mockk is multiplatform but I prefer just using fakes. ktor has a mocking feature/plugin. About realm I have no idea
1
n

Napa Ram

06/28/2021, 11:38 AM
if you have any reference let me know thanks for info
j

Javier

06/28/2021, 11:39 AM
mockk and ktor have really good docs, you can get it from their repos
r

Róbert Nagy

06/28/2021, 12:09 PM
afaik K/N support from mockk is still wip: https://github.com/mockk/mockk/issues/58
m

Mustafa Ozhan

06/28/2021, 3:03 PM
I have used fakes in my project for testing viewmodels https://github.com/CurrencyConverterCalculator/CCC you can check
client>src>commonTest
2 Views