kevin.cianfarini
08/22/2023, 2:57 PMClock
? Maybe they could be as simple as:
class StaticFakeClock(private val now: Instant) {
override fun now(): Instant = now
}
class DynamicFakeClock(val times: ArrayDeque<Instant>) {
override fun now(): Instant = times.removeFirst()
}
This could potentially also provide reference implementations for a clock that integrates with the coroutines test time source? That seems to be a really common question that pops up in this slack.Pablichjenkov
08/22/2023, 3:13 PMkevin.cianfarini
08/22/2023, 3:26 PMTgo1014
08/22/2023, 3:27 PMCLOVIS
08/22/2023, 4:22 PMCLOVIS
08/22/2023, 4:22 PMhfhbd
08/23/2023, 5:32 AMdewildte
08/28/2023, 6:52 PMCLOVIS
08/28/2023, 7:16 PMdewildte
08/28/2023, 7:17 PMkevin.cianfarini
02/12/2024, 8:37 PM