commonTest.com.arkivanov.mvikotlin.timetravel.proto.internal.data.AbstractReadWriteTest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mvikotlin-timetravel-proto-internal Show documentation
Show all versions of mvikotlin-timetravel-proto-internal Show documentation
Kotlin Multiplatform MVI framework
package com.arkivanov.mvikotlin.timetravel.proto.internal.data
import com.arkivanov.mvikotlin.timetravel.proto.internal.io.DataReader
import com.arkivanov.mvikotlin.timetravel.proto.internal.io.DataWriter
import kotlin.test.assertEquals
internal abstract class AbstractReadWriteTest {
protected fun testWriteRead(obj: T) {
val writer = DataWriter()
writer.writeObject(obj)
val reader = DataReader(writer.data)
val readObj = reader.readObject()
assertEquals(obj, readObj)
}
protected abstract fun DataWriter.writeObject(obj: T)
protected abstract fun DataReader.readObject(): T
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy