Skip to content

Commit

Permalink
use to contain instead of contains and expectation instead assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
robstoll committed Sep 26, 2023
1 parent d4933f1 commit 288b3fe
Show file tree
Hide file tree
Showing 17 changed files with 108 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import ch.tutteli.kbox.glue
import kotlin.jvm.JvmName

/**
* Finishes the specification of the sophisticated `contains` assertion where the [expected] object shall be searched,
* Finishes the specification of the sophisticated `to contain` expectation where the [expected] object shall be searched,
* using a non-disjoint search.
*
* Delegates to [values].
Expand All @@ -41,7 +41,7 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.value(expected: CharS
values(expected)

/**
* Finishes the specification of the sophisticated `contains` assertion where the [expected] value as well as
* Finishes the specification of the sophisticated `to contain` expectation where the [expected] value as well as
* the [otherExpected] values shall be searched, using a non-disjoint search.
*
* Notice that a runtime check applies which assures that only [CharSequence], [Number] and [Char] are passed.
Expand Down Expand Up @@ -76,7 +76,7 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.values(


/**
* Finishes the specification of the sophisticated `contains` assertion where the [expected] value shall be searched
* Finishes the specification of the sophisticated `to contain` expectation where the [expected] value shall be searched
* (ignoring case), using a non-disjoint search.
*
* Delegates to `values(expected)`.
Expand All @@ -101,7 +101,7 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.value(
): Expect<T> = values(expected)

/**
* Finishes the specification of the sophisticated `contains` assertion where the [expected] value as well as
* Finishes the specification of the sophisticated `to contain` expectation where the [expected] value as well as
* the [otherExpected] values shall be searched (ignoring case), using a non-disjoint search.
*
* Notice that a runtime check applies which assures that only [CharSequence], [Number] and [Char] are passed.
Expand Down Expand Up @@ -137,7 +137,7 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.values(


/**
* Finishes the specification of the sophisticated `contains` assertion where the [expected] value shall be searched
* Finishes the specification of the sophisticated `to contain` expectation where the [expected] value shall be searched
* (ignoring case), using a non-disjoint search where it needs to be contained at least once.
*
* Delegates to `atLeast(1).value(expected)`.
Expand All @@ -161,7 +161,7 @@ fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.value(
): Expect<T> = atLeast(1).value(expected)

/**
* Finishes the specification of the sophisticated `contains` assertion where the [expected] value as well as
* Finishes the specification of the sophisticated `to contain` expectation where the [expected] value as well as
* the [otherExpected] values shall be searched (ignoring case), using a non-disjoint search
* where each need to be contained at least once.
*
Expand Down Expand Up @@ -192,7 +192,7 @@ fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.values(
): Expect<T> = atLeast(1).values(expected, *otherExpected)

/**
* Finishes the specification of the sophisticated `contains` assertion where the given regular expression [pattern]
* Finishes the specification of the sophisticated `to contain` expectation where the given regular expression [pattern]
* as well as the [otherPatterns] are expected to have a match, using a non-disjoint search.
*
* By non-disjoint is meant that `"aa"` in `"aaaa"` is found three times and not only two times.
Expand Down Expand Up @@ -220,7 +220,7 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.regex(
): Expect<T> = _logicAppend { regex(pattern glue otherPatterns) }

/**
* Finishes the specification of the sophisticated `contains` assertion where the given [Regex] [pattern]
* Finishes the specification of the sophisticated `to contain` expectation where the given [Regex] [pattern]
* as well as the [otherPatterns] are expected to have a match, using a non-disjoint search.
*
* By non-disjoint is meant that `"aa"` in `"aaaa"` is found three times and not only two times.
Expand Down Expand Up @@ -251,7 +251,7 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.regex(
): Expect<T> = _logicAppend { regex(pattern glue otherPatterns) }

/**
* Finishes the specification of the sophisticated `contains` assertion where the given [Regex] [pattern]
* Finishes the specification of the sophisticated `to contain` expectation where the given [Regex] [pattern]
* as well as the [otherPatterns] are expected to have a match, using a non-disjoint search.
*
* By non-disjoint is meant that `"aa"` in `"aaaa"` is found three times and not only two times.
Expand Down Expand Up @@ -281,7 +281,7 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.matchFor(
): Expect<T> = _logicAppend { regex(pattern glue otherPatterns) }

/**
* Finishes the specification of the sophisticated `contains` assertion where the given regular expression [pattern]
* Finishes the specification of the sophisticated `to contain` expectation where the given regular expression [pattern]
* as well as the [otherPatterns] are expected to have a match (ignoring case), using a non-disjoint search.
*
* By non-disjoint is meant that `"aa"` in `"aaaa"` is found three times and not only two times.
Expand Down Expand Up @@ -310,7 +310,7 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.regex(
): Expect<T> = _logicAppend { regexIgnoringCase(pattern glue otherPatterns) }

/**
* Finishes the specification of the sophisticated `contains` assertion where the given regular expression [pattern]
* Finishes the specification of the sophisticated `to contain` expectation where the given regular expression [pattern]
* as well as the [otherPatterns] are expected to to have at least one match (ignoring case),
* using a non-disjoint search.
*
Expand Down Expand Up @@ -341,7 +341,7 @@ fun <T : CharSequence> EntryPointStep<T, IgnoringCaseSearchBehaviour>.regex(
): Expect<T> = atLeast(1).regex(pattern, *otherPatterns)

/**
* Finishes the specification of the sophisticated `contains` assertion where all elements of the [expectedIterableLike]
* Finishes the specification of the sophisticated `to contain` expectation where all elements of the [expectedIterableLike]
* shall be searched, using a non-disjoint search.
*
* Delegates to `values(expectedIterable.first(), *expectedIterable.drop(1).toTypedArray())`
Expand Down Expand Up @@ -371,7 +371,7 @@ fun <T : CharSequence> CheckerStep<T, NoOpSearchBehaviour>.elementsOf(


/**
* Finishes the specification of the sophisticated `contains` assertion where all elements of the [expectedIterableLike]
* Finishes the specification of the sophisticated `to contain` expectation where all elements of the [expectedIterableLike]
* shall be searched (ignoring case), using a non-disjoint search.
*
* Delegates to `values(expectedIterable.first(), *expectedIterable.drop(1).toTypedArray())`
Expand Down Expand Up @@ -400,7 +400,7 @@ fun <T : CharSequence> CheckerStep<T, IgnoringCaseSearchBehaviour>.elementsOf(
.let { (first, rest) -> values(first, *rest) }

/**
* Finishes the specification of the sophisticated `contains` assertion where all elements of the [expectedIterableLike]
* Finishes the specification of the sophisticated `to contain` expectation where all elements of the [expectedIterableLike]
* shall be searched (ignoring case), using a non-disjoint search.
*
* Delegates to `values(expectedIterable.first(), *expectedIterable.drop(1).toTypedArray())`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ch.tutteli.atrium.logic.utils.toVarArg
import ch.tutteli.kbox.glue

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain the [expected] value.
*
* Delegates to [values].
Expand All @@ -29,7 +29,7 @@ fun <E, T: IterableLike> CheckerStep<E, T, InAnyOrderSearchBehaviour>.value(expe
values(expected)

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain the [expected] value as well as the [otherExpected] values where it does not matter
* in which order they appear.
*
Expand All @@ -56,7 +56,7 @@ fun <E, T: IterableLike> CheckerStep<E, T, InAnyOrderSearchBehaviour>.values(
): Expect<T> = _logicAppend { values(expected glue otherExpected, StaticNames.notToHaveElementsOrNone) }

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain an entry which either holds all assertions [assertionCreatorOrNull] creates or
* needs to be `null` in case [assertionCreatorOrNull] is defined as `null`.
*
Expand All @@ -75,7 +75,7 @@ fun <E : Any, T: IterableLike> CheckerStep<out E?, T, InAnyOrderSearchBehaviour>
): Expect<T> = entries(assertionCreatorOrNull)

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain an entry for [assertionCreatorOrNull] as well as for the [otherAssertionCreatorsOrNulls]
* where it does not matter in which order they appear -- an entry is contained if it either
* holds all assertions [assertionCreatorOrNull] creates or
Expand All @@ -97,7 +97,7 @@ fun <E : Any, T: IterableLike> CheckerStep<out E?, T, InAnyOrderSearchBehaviour>
): Expect<T> = _logicAppend { entries(assertionCreatorOrNull glue otherAssertionCreatorsOrNulls, StaticNames.notToHaveElementsOrNone) }

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain all elements of the [expectedIterableLike] where it does not matter in which order they appear.
*
* Delegates to [values] which also means that it does not search for unique matches
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ch.tutteli.atrium.logic.utils.toVarArg
import ch.tutteli.kbox.glue

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain only the [expected] value.
*
* Delegates to [values].
Expand All @@ -31,7 +31,7 @@ fun <E, T : IterableLike> EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.va
values(expected)

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain only the [expected] value as well as the [otherExpected] values
* where it does not matter in which order.
*
Expand All @@ -52,7 +52,7 @@ fun <E, T : IterableLike> EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.va
): Expect<T> = _logicAppend { valuesInAnyOrderOnly(expected glue otherExpected, report) }

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain only one entry which holds all assertions created by the given [assertionCreatorOrNull]
* or is `null` in case [assertionCreatorOrNull] is defined as `null`.
*
Expand All @@ -71,7 +71,7 @@ fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InAnyOrderOnlySearchBe
): Expect<T> = entries(assertionCreatorOrNull)

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain only an entry for [assertionCreatorOrNull] as well as for the [otherAssertionCreatorsOrNulls]
* where it does not matter in which order they appear -- an entry is contained if it either
* holds all assertions [assertionCreatorOrNull] creates or
Expand Down Expand Up @@ -105,7 +105,7 @@ fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InAnyOrderOnlySearchBe
): Expect<T> = _logicAppend { entriesInAnyOrderOnly(assertionCreatorOrNull glue otherAssertionCreatorsOrNulls, report) }

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain only and all elements of [expectedIterableLike] where it does not matter in which order.
*
* Delegates to [values].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ch.tutteli.atrium.logic.utils.toVarArg
import ch.tutteli.kbox.glue

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain only the [expected] value.
*
* Delegates to [values].
Expand All @@ -29,7 +29,7 @@ fun <E, T : IterableLike> EntryPointStep<E, T, InOrderOnlySearchBehaviour>.value
values(expected)

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain only the [expected] value as well as the [otherExpected] values
* in the specified order.
*
Expand All @@ -50,7 +50,7 @@ fun <E, T : IterableLike> EntryPointStep<E, T, InOrderOnlySearchBehaviour>.value
): Expect<T> = _logicAppend { valuesInOrderOnly(expected glue otherExpected, report) }

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain only one entry which holds all assertions created by the given [assertionCreatorOrNull]
* or is `null` in case [assertionCreatorOrNull] is defined as `null`.
*
Expand All @@ -69,7 +69,7 @@ fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InOrderOnlySearchBehav
): Expect<T> = entries(assertionCreatorOrNull)

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain only an entry for [assertionCreatorOrNull] as well as for the [otherAssertionCreatorsOrNulls]
* in the specified order -- an entry is contained if it either
* holds all assertions [assertionCreatorOrNull] creates or
Expand All @@ -95,7 +95,7 @@ fun <E : Any, T : IterableLike> EntryPointStep<out E?, T, InOrderOnlySearchBehav
): Expect<T> = _logicAppend { entriesInOrderOnly(assertionCreatorOrNull glue otherAssertionCreatorsOrNulls, report) }

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (an [IterableLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (an [IterableLike])
* needs to contain only and all elements of [expectedIterableLike] in the specified order.
*
* Delegates to [values].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ch.tutteli.atrium.logic.creating.iterablelike.contains.reporting.InOrderO
import kotlin.jvm.JvmName

/**
* Finishes the specification of the sophisticated `contains` assertion where the expected [firstGroup] as well as
* Finishes the specification of the sophisticated `to contain` expectation where the expected [firstGroup] as well as
* the [secondGroup] and optionally [otherExpectedGroups] of values need to be contained in [IterableLike]
* as only elements and in the specified order whereas the values within the groups can occur in any order.
*
Expand Down Expand Up @@ -45,7 +45,7 @@ fun <E, T : IterableLike> EntryPointStep<E, T, InOrderOnlyGroupedWithinSearchBeh
}

/**
* Finishes the specification of the sophisticated `contains` assertion where the expected [firstGroup] as well as
* Finishes the specification of the sophisticated `to contain` expectation where the expected [firstGroup] as well as
* the [secondGroup] and optionally [otherExpectedGroups] of identification lambdas, identifying an entry,
* need to be contained in [IterableLike] as only elements and in the specified order whereas
* the identification lambdas within the groups can occur in any order.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ch.tutteli.kbox.glue
import kotlin.reflect.KClass

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (a [MapLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (a [MapLike])
* needs to contain the given [keyValuePair].
*
* Delegates to [entries].
Expand All @@ -26,7 +26,7 @@ fun <K, V, T : MapLike> EntryPointStep<K, V, T, InAnyOrderSearchBehaviour>.entry
entries(keyValuePair)

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (a [MapLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (a [MapLike])
* needs to contain the given [keyValuePair] as well as the [otherPairs] where it does not matter
* in which order they appear.
*
Expand All @@ -44,7 +44,7 @@ fun <K, V, T : MapLike> EntryPointStep<K, V, T, InAnyOrderSearchBehaviour>.entri
): Expect<T> = _logicAppend { keyValuePairsInAnyOrder(keyValuePair glue otherPairs) }

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (a [MapLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (a [MapLike])
* needs to contain an entry with a key as defined by [keyValue]'s [KeyValue.key] and
* a corresponding value which either holds all assertions [keyValue]'s
* [KeyValue.valueAssertionCreatorOrNull] creates or needs to be `null` in case
Expand All @@ -61,7 +61,7 @@ inline fun <K, reified V : Any, T : MapLike> EntryPointStep<K, out V?, T, InAnyO
): Expect<T> = entries(keyValue)

/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (a [MapLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (a [MapLike])
* needs to contain the given [keyValue] as well as the [otherKeyValues] where it does not matter
* in which order they appear -- an entry is contained if it has a key as defined by [keyValue]'s [KeyValue.key] and
* a corresponding value which either holds all assertions [keyValue]'s
Expand Down Expand Up @@ -91,7 +91,7 @@ internal fun <K, V : Any, T : MapLike> EntryPointStep<K, out V?, T, InAnyOrderSe


/**
* Finishes the specification of the sophisticated `contains` assertion where the subject (a [MapLike])
* Finishes the specification of the sophisticated `to contain` expectation where the subject (a [MapLike])
* needs to contain all entries of the given [expectedMapLike] where it does not matter
* in which order they appear.
*
Expand Down
Loading

0 comments on commit 288b3fe

Please sign in to comment.