All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.kotlin.ch.tutteli.atrium.logic.logicCharSequenceContains.kt Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
@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.charsequence.contains.CharSequenceContains
import ch.tutteli.atrium.logic.creating.charsequence.contains.steps.WithTimesCheckerStep
import ch.tutteli.atrium.logic.creating.charsequence.contains.steps.WithTimesCheckerStepInternal
import ch.tutteli.atrium.logic.creating.charsequence.contains.steps.WithTimesCheckerStepLogic
import ch.tutteli.atrium.reporting.BUG_REPORT_URL

/**
 * 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 [CharSequence].
 */
inline val 
    CharSequenceContains.EntryPointStep._logic: CharSequenceContains.EntryPointStepLogic
    get() = when (this) {
        is CharSequenceContains.EntryPointStepInternal -> this
        else -> throw UnsupportedOperationException("Unsupported CharSequenceContains.Builder: $this -- please open an issue that a hook shall be implemented: $BUG_REPORT_URL?template=feature_request&title=Hook%20for%20CharSequenceContains.EntryPointStep._logic")
    }

/**
 * 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 [CharSequence].
 */
inline val 
    WithTimesCheckerStep._logic: WithTimesCheckerStepLogic
    get() = when (this) {
        is WithTimesCheckerStepInternal -> this
        else -> throw UnsupportedOperationException("Unsupported WithTimesCheckerStep: $this -- please open an issue that a hook shall be implemented: $BUG_REPORT_URL?template=feature_request&title=Hook%20for%20CharSequenceContains%20WithTimesCheckerStep._logic")
    }

/**
 * Appends the [Assertion] the given [factory] creates based on this [CharSequenceContains.CheckerStep].
 *
 * Use [_logic] for more sophisticated scenarios.
 */
inline fun 
    CharSequenceContains.CheckerStep._logicAppend(
    factory: CharSequenceContains.CheckerStepLogic.() -> Assertion
): Expect = _logic.let { l -> l.entryPointStepLogic.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 [CharSequence].
 */
inline val 
    CharSequenceContains.CheckerStep._logic: CharSequenceContains.CheckerStepLogic
    get() = when (this) {
        is CharSequenceContains.CheckerStepInternal -> this
        else -> throw UnsupportedOperationException("Unsupported CharSequenceContains.CheckerStep: $this -- please open an issue that a hook shall be implemented: $BUG_REPORT_URL?template=feature_request&title=Hook%20for%20CharSequenceContains.CheckerStep._logic")
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy