Proyek
Lihat di GitHub
lupuuss/Mokkery
Tentang
The mocking library for Kotlin Multiplatform, easy to use, boilerplate-free and compiler plugin driven.
Bahasa pemrograman dan runtimePertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- +2
- dalam 15 hari
- +3
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliThe mocking library for Kotlin Multiplatform, easy to use, boilerplate-free and compiler plugin driven.
class BookServiceTest {
val repository = mock<BookRepository> {
everySuspend { findById(any()) } calls { (id: String) -> Book(id) }
}
val service = BookService(repository)
@Test
fun `rent should call repository for each book`() = runTest {
service.rentAll(listOf("1", "2"))
verifySuspend(exhaustiveOrder) {
repository.findById("1")
repository.findById("2")
}
}
}
As shown in the example above, this library is highly inspired by the MockK. If you have any experience with MockK, it should be easy to start with Mokkery!
Documentation is available here!
Jelajahi proyek terkait
Memuat…