FakeSpec

class FakeSpec<Root>

Per-call configuration for generating a Root value.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Generates value for this nested property path.

Generates this nested property path using Fiktion's automatic generation.

Generates this nested collection property path by automatically generating each element.

@JvmName(name = "generatesAutoMapPath")
infix fun <Key, Value, MapType : Map<Key, Value>> PropertyPath<Root, MapType>.generates(auto: Auto): MapGenerationSpec<Key, Value, MapType>

Generates this nested map property path by automatically generating each key and value.

infix inline fun <Value> KProperty1<Root, Value>.generates(value: Value): GenerationSpec<Value>

Generates value for this property.

Generates this property using Fiktion's automatic generation.

@JvmName(name = "generatesAutoCollectionProperty")
infix inline fun <Element, CollectionType : Collection<Element>> KProperty1<Root, CollectionType>.generates(auto: Auto): CollectionGenerationSpec<Element, CollectionType>

Generates this collection property by automatically generating each element.

@JvmName(name = "generatesAutoMapProperty")
infix inline fun <Key, Value, MapType : Map<Key, Value>> KProperty1<Root, MapType>.generates(auto: Auto): MapGenerationSpec<Key, Value, MapType>
fun <Key, Value, MapType : Map<Key, Value>> KProperty1<Root, MapType>.generates(auto: Auto, mapType: KType, keyType: KType, valueType: KType): MapGenerationSpec<Key, Value, MapType>

Generates this map property by automatically generating each key and value.

Link copied to clipboard

Generates this nested property path by invoking generator.

infix inline fun <Value> KProperty1<Root, Value>.generatesBy(noinline generator: Generator<Value>): GenerationSpec<Value>

Generates this property by invoking generator.

Link copied to clipboard

Generates each element for this nested collection property path by invoking generator.

Generates each entry for this nested map property path by invoking generator.

Generates each element for this collection property by invoking generator.

infix inline fun <Key, Value, MapType : Map<Key, Value>> KProperty1<Root, MapType>.generatesEach(noinline generator: Generator<Pair<Key, Value>>): MapEntrySpec<Key, Value, MapType>
fun <Key, Value, MapType : Map<Key, Value>> KProperty1<Root, MapType>.generatesEach(generator: Generator<Pair<Key, Value>>, mapType: KType, keyType: KType, valueType: KType): MapEntrySpec<Key, Value, MapType>

Generates each entry for this map property by invoking generator.

Link copied to clipboard

Generates map keys for this nested property path by invoking generator.

infix inline fun <Key, Value, MapType : Map<Key, Value>> KProperty1<Root, MapType>.generatesKeys(noinline generator: Generator<Key>): MapKeySpec<Key, Value, MapType>
fun <Key, Value, MapType : Map<Key, Value>> KProperty1<Root, MapType>.generatesKeys(generator: Generator<Key>, mapType: KType, keyType: KType, valueType: KType): MapKeySpec<Key, Value, MapType>

Generates map keys for this property by invoking generator.

Link copied to clipboard

Generates map values for this nested property path by invoking generator.

fun <Key, Value, MapType : Map<Key, Value>> KProperty1<Root, MapType>.generatesValues(generator: Generator<Value>, mapType: KType, keyType: KType, valueType: KType): MapValueSpec<Key, Value, MapType>

Generates map values for this property by invoking generator.

Link copied to clipboard
operator fun <Value> PropertyPath<Root, Value>.invoke(configure: FakeSpec<Value>.() -> Unit): GenerationSpec<Value>

Applies nested per-call configuration to this property path.

inline operator fun <Value> KProperty1<Root, Value>.invoke(noinline configure: FakeSpec<Value>.() -> Unit): GenerationSpec<Value>
operator fun <Value> KProperty1<Root, Value>.invoke(configure: FakeSpec<Value>.() -> Unit, value: KType): GenerationSpec<Value>

Applies nested per-call configuration to this property.

Link copied to clipboard

Targets properties generated while building Root whose name is name, inferring the value type from the generator.

Targets properties generated while building Root whose name matches regex, inferring the value type from the generator.

inline fun <Value> name(name: String, typed: Unit = Unit): RuleTarget<Value>

Targets properties generated while building the current root whose value type is Value and name is name.

fun name(name: String, value: KType): RuleTarget<*>

Targets properties generated while building Root whose value type is value and name is name.

inline fun <Value> name(regex: Regex, typed: Unit = Unit): RuleTarget<Value>

Targets properties generated while building the current root whose value type is Value and name matches regex.

fun name(regex: Regex, value: KType): RuleTarget<*>

Targets properties generated while building Root whose value type is value and name matches regex.

Link copied to clipboard

Targets a nested path starting from Root.

inline fun <Value> property(property: KProperty1<Root, Value>): RuleTarget<Value>
fun <Value> property(property: KProperty1<Root, Value>, value: KType): RuleTarget<Value>

Targets property on Root.

Link copied to clipboard
infix fun withSeed(seed: Long)

Sets the seed for this generation call.