FakeSpec

class FakeSpec<Root>

Per-call configuration for generating a Root value.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Targets elements generated for the current collection root.

Link copied to clipboard

Targets keys generated for the current map root.

Link copied to clipboard

Targets values generated for the current map root.

Functions

Link copied to clipboard

Generates value for this nested property path.

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

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.

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
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.

Groups declarations for a nested path starting from Root.

inline fun <Value> property(property: KProperty1<Root, Value>, noinline configure: RuleTarget<Value>.() -> Unit): RuleTarget<Value>

Groups declarations for property on Root.

Link copied to clipboard
infix fun <Value : Any> using(value: FiktionConfigSetting<in Root, Value>)
fun <Value : Any> using(key: FiktionConfig<in Root, Value>, value: Value)

Configures the root value generated by this call.

Configures built-in or add-on generator behavior for this property.

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

Sets the seed for this generation call.