AkshayChordiya / News

A sample News 🗞 app built using Modern Android Development [Architecture Components, Coroutines, Retrofit, Room, Kotlin, Dagger]
MIT License
848 stars 166 forks source link

Room's Insert with List gives incorrect values #27

Closed iNoles closed 4 years ago

iNoles commented 4 years ago

If you are unit testing on

@Insert
 fun insertArticles(articles: List<NewsArticles>): List<Long>

it always output as [].

AkshayChordiya commented 4 years ago

Yeah I think it's because of in-memory database 🤔

iNoles commented 4 years ago

I found another way of doing it. https://code.luasoftware.com/tutorials/android/android-room-batch-insert-or-update/