Guilherme Delgado
08/13/2024, 4:04 PM@Test
fun testCountStream() = runTest {
dao.countStream().test {
dao.insert(...)
assertEquals(1, awaitItem().size)
dao.insert(...)
assertEquals(2, awaitItem().size)
cancelAndIgnoreRemainingEvents()
}
}
Certainly, my problem lies with the library’s syntax. I’ve been looking at the documentation and doing some experiments, but I haven’t had any success. Can someone give me a tip? Thanks 🙌saket
08/13/2024, 4:35 PMGuilherme Delgado
08/13/2024, 4:36 PMsaket
08/13/2024, 4:57 PMsaket
08/13/2024, 4:58 PMdistinctUntilChange()
could also help if this is a case of duplicate emissions from the databaseGuilherme Delgado
08/13/2024, 5:21 PMGuilherme Delgado
08/13/2024, 5:29 PMassertEquals(0, awaitItem().size)
🤦♂️