kotest-core / io.kotest.core.factory / TestFactory

TestFactory

data class TestFactory

A TestFactory is a generator of tests along with optional configuration and callbacks related to those tests. A test factory can be added to a Spec and the tests generated by the factory will be included in that spec.

Constructors

<init>

A TestFactory is a generator of tests along with optional configuration and callbacks related to those tests. A test factory can be added to a Spec and the tests generated by the factory will be included in that spec.

TestFactory(factoryId: TestFactoryId, tests: List<DynamicTest>, tags: Set<Tag>, assertionMode: AssertionMode?, listeners: List<TestListener>, extensions: List<Extension>, factories: List<TestFactory>)

Properties

assertionMode

val assertionMode: AssertionMode?

extensions

val extensions: List<Extension>

factories

val factories: List<TestFactory>

factoryId

val factoryId: TestFactoryId

listeners

val listeners: List<TestListener>

tags

val tags: Set<Tag>

tests

val tests: List<DynamicTest>

Extension Functions

generate

Generates a TestCase for each DynamicTest in this factory. Tags and assertion mode are applied to the tests. Any included factories are recursively called and their generated tests included in the returned list.

fun TestFactory.generate(description: Description, spec: Spec): List<TestCase>