All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmTest.RecordingModelObserver.kt Maven / Gradle / Ivy

package kt.mobius

import kt.mobius.functions.Consumer

class RecordingModelObserver : Consumer {

    private val recorder = RecordingConsumer()

    override fun accept(newModel: S) {
        recorder.accept(newModel)
    }

    /*fun waitForChange(timeoutMs: Long): Boolean {
      return recorder.waitForChange(timeoutMs)
    }*/

    fun valueCount(): Int {
        return recorder.valueCount()
    }

    @SafeVarargs
    fun assertStates(vararg expectedStates: S) {
        recorder.assertValues(*expectedStates)
    }
}