main.kotlin.ch.tutteli.atrium.logic.logicMapLikeContains.kt Maven / Gradle / Ivy
@file:Suppress("ObjectPropertyName", "FunctionName")
package ch.tutteli.atrium.logic
import ch.tutteli.atrium.assertions.Assertion
import ch.tutteli.atrium.creating.Expect
import ch.tutteli.atrium.logic.creating.maplike.contains.MapLikeContains
import ch.tutteli.atrium.reporting.BUG_REPORT_URL
/**
* Appends the [Assertion] the given [factory] creates based on this [MapLikeContains.EntryPointStep].
*
* Use [_logic] for more sophisticated scenarios.
*/
inline fun
MapLikeContains.EntryPointStep._logicAppend(
factory: MapLikeContains.EntryPointStepLogic.() -> Assertion
): Expect = _logic.let { l -> l.container.append(l.factory()) }
/**
* Entry point to the logic level of Atrium -- which is one level deeper than the API --
* within the building process of a sophisticated `contains` assertion for [Iterable].
*/
inline val
MapLikeContains.EntryPointStep._logic: MapLikeContains.EntryPointStepLogic
get() = when (this) {
is MapLikeContains.EntryPointStepInternal -> this
else -> throw UnsupportedOperationException("Unsupported MapLikeContains.Builder: $this -- please open an issue that a hook shall be implemented: $BUG_REPORT_URL?template=feature_request&title=Hook%20for%20MapLikeContains.EntryPointStep._logic")
}