run.smt.ktest.api.Case.kt Maven / Gradle / Ivy
package run.smt.ktest.api
import java.time.Duration
import java.util.*
data class Case(
val suite: Suite,
val name: String,
val metaData: MetaData,
val body: () -> Unit
) {
val uid = UUID.randomUUID().toString()
val inheritedMetadata = metaData + suite.inheritedMetaData
private val disabled = metaData.filterIsInstance().firstOrNull()
val disablingReason = disabled?.value
val enabled = disabled == null
val invocations = metaData.filterIsInstance().firstOrNull()?.value ?: 1
val timeout = metaData.filterIsInstance().firstOrNull()?.value ?: Duration.ofNanos(Long.MAX_VALUE)!!
val threads = metaData.filterIsInstance().firstOrNull()?.value ?: 1
}