Ofir Bar
inline fun<reified T> Any.deepCopy(): T { val JSON = Gson().toJson(this) return Gson().fromJson(JSON, T::class.java) }
LinkedTreeMap
svenjacobs
class CouponListInteractor( private val isCouponSelectedUseCase: IsCouponSelectedUseCase ) { suspend fun isCouponSelected(uuid: String) = isCouponSelectedUseCase.execute(uuid) } object CouponListInteractorTest : Spek( { val isCouponSelectedUseCase by memoized { mockk<IsCouponSelectedUseCase> { coEvery { execute(any()) } returns false coEvery { execute("uuid") } returns true } } val interactor = CouponListInteractor( isCouponSelectedUseCase ) describe("CouponListInteractor") { context("isCouponSelected") { it("should return coupon selected state") { runBlockingTest { interactor.isCouponSelected("uuid") shouldEqual true } coVerify { // ERROR: Bad recording sequence. State: AnsweringState isCouponSelectedUseCase.execute("uuid") } } } } }
coVerify
Bad recording sequence. State: AnsweringState
interactor.isCouponSelected("uuid") shouldEqual true
isCouponSelectedUseCase.execute("uuid") shouldEqual true
isCouponSelected()
aoriani
jean
[plugins] kotlin-android = {id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
Error resolving plugin [id: 'org.jetbrains.kotlin.android', version: '1.5.30']
implementation("org.jetbrains.kotlin.android:org.jetbrains.kotlin.android.gradle.plugin:1.5.30")
id
samuel
fastInit
kapt { javacOptions { option("-Adagger.fastInit=enabled") } }
warning: The following options were not recognized by any processor: '[dagger.fastInit, kapt.kotlin.generated]' The following options were not recognized by any processor: '[dagger.fastInit, kapt.kotlin.generated]'
Bheem
Marcin Wisniowski
SharedTransitionLayout
LazyColumn
dropUnlessResumed
2.8.0
czuckie
drawWithContent
Box
Стефан Јовановић
class ProductApi { private val baseUrl = "<https://fakestoreapi.com/>" private val httpClient = HttpClient { install(ContentNegotiation) { json(Json { prettyPrint = true isLenient = true ignoreUnknownKeys = true }) } } suspend fun fetchProducts(limit: Int): Flow<List<Product>> { return flow { // Delay to show a loading state. delay(2000) try { emit(httpClient.get(urlString = "${baseUrl}products?limit=$limit").body()) } catch (e: Exception) { emit(emptyList()) } } } }
A modern programming language that makes developers happier.