mirror of
https://github.com/jlengrand/atrium.git
synced 2026-03-10 08:01:19 +00:00
change @since 0.10.0 for new infix api to 0.11.0
This commit is contained in:
@@ -156,7 +156,7 @@ inline infix fun <reified TSub : Any> Expect<*>.isA(noinline assertionCreator: E
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline infix fun <T> Expect<T>.and(@Suppress("UNUSED_PARAMETER") o: o): Expect<T> = this
|
||||
|
||||
@@ -199,7 +199,7 @@ infix fun <T : CharSequence> Expect<T>.startsWith(expected: CharSequence) =
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.startsWith(expected: Char) =
|
||||
o startsWith expected.toString()
|
||||
@@ -219,7 +219,7 @@ infix fun <T : CharSequence> Expect<T>.startsNotWith(expected: CharSequence) =
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.startsNotWith(expected: Char) =
|
||||
o startsNotWith expected.toString()
|
||||
@@ -240,7 +240,7 @@ infix fun <T : CharSequence> Expect<T>.endsWith(expected: CharSequence) =
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.endsWith(expected: Char) =
|
||||
o endsWith expected.toString()
|
||||
@@ -260,7 +260,7 @@ infix fun <T : CharSequence> Expect<T>.endsNotWith(expected: CharSequence) =
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.endsNotWith(expected: Char) =
|
||||
o endsNotWith expected.toString()
|
||||
@@ -305,7 +305,7 @@ infix fun <T : CharSequence> Expect<T>.notToBe(@Suppress("UNUSED_PARAMETER") Bla
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.matches(expected: Regex) =
|
||||
addAssertion(ExpectImpl.charSequence.matches(this, expected))
|
||||
@@ -318,7 +318,7 @@ infix fun <T : CharSequence> Expect<T>.matches(expected: Regex) =
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : CharSequence> Expect<T>.mismatches(expected: Regex) =
|
||||
addAssertion(ExpectImpl.charSequence.mismatches(this, expected))
|
||||
|
||||
@@ -179,7 +179,7 @@ infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.regex(pattern
|
||||
* @return The [Expect] for which the assertion was built to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.matchFor(
|
||||
pattern: Regex
|
||||
@@ -230,7 +230,7 @@ infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.the(patterns:
|
||||
* @return The [Expect] for which the assertion was built to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.matchFor(patterns: All<Regex>): Expect<T> =
|
||||
addAssertion(ExpectImpl.charSequence.contains.regex(this, patterns.toList()))
|
||||
@@ -336,7 +336,7 @@ infix fun <T : CharSequence> Builder<T, IgnoringCaseSearchBehaviour>.the(pattern
|
||||
* @throws IllegalArgumentException in case [expectedIterable] is not a [CharSequence], [Number] or [Char] or the given
|
||||
* [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.elementsOf(
|
||||
expectedIterable: Iterable<Any>
|
||||
@@ -365,7 +365,7 @@ infix fun <T : CharSequence> CheckerOption<T, NoOpSearchBehaviour>.elementsOf(
|
||||
* @throws IllegalArgumentException in case [expectedIterable] is not a [CharSequence], [Number] or [Char] or the given
|
||||
* [expectedIterable] does not have elements (is empty).
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
@JvmName("elementsOfIgnoringCase")
|
||||
infix fun <T : CharSequence> CheckerOption<T, IgnoringCaseSearchBehaviour>.elementsOf(
|
||||
|
||||
@@ -13,6 +13,6 @@ import kotlin.reflect.KProperty1
|
||||
* @property description The description of the feature.
|
||||
* @property extractor The extractor which extracts the feature out of the subject of the assertion.
|
||||
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
data class Feature<T, R>(val description: String, val extractor: (T) -> R)
|
||||
|
||||
@@ -16,7 +16,7 @@ import kotlin.reflect.KProperty1
|
||||
* @property extractor The extractor which extracts the feature out of the subject of the assertion.
|
||||
* @property assertionCreator The `assertionCreator`-lambda which defines assertions for the feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
data class FeatureWithCreator<T, R>(
|
||||
val description: String,
|
||||
|
||||
@@ -14,7 +14,7 @@ import ch.tutteli.atrium.domain.creating.MetaFeature
|
||||
* Usually you use [f][MetaFeatureOption.f] to create a [MetaFeature],
|
||||
* e.g. `feature of({ f(it::size) }) { o toBe 3 }`
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
data class MetaFeatureOptionWithCreator<T, R>(
|
||||
val provider: MetaFeatureOption<T>.(T) -> MetaFeature<R>,
|
||||
|
||||
@@ -9,6 +9,6 @@ import ch.tutteli.atrium.creating.Expect
|
||||
*
|
||||
* Use the function `index(Int) { ... }` to create this representation.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
data class IndexWithCreator<E>(val index: Int, val assertionCreator: Expect<E>.() -> Unit)
|
||||
|
||||
@@ -9,6 +9,6 @@ import ch.tutteli.atrium.creating.Expect
|
||||
* Use the function `key(...) { ... }` to create this representation where the first parameter corresponds
|
||||
* to the [key] and the second is the [assertionCreator]
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
data class KeyWithCreator<out K, V>(val key: K, val assertionCreator: Expect<V>.() -> Unit)
|
||||
|
||||
@@ -19,7 +19,7 @@ import kotlin.reflect.*
|
||||
*
|
||||
* @return The newly created [Expect] for the given [property].
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T, R> Expect<T>.feature(property: KProperty1<in T, R>): FeatureExpect<T, R> =
|
||||
ExpectImpl.feature.property(this, property).getExpectOfFeature()
|
||||
@@ -35,7 +35,7 @@ infix fun <T, R> Expect<T>.feature(property: KProperty1<in T, R>): FeatureExpect
|
||||
* @return The newly created [Expect] for the return value of calling the method [f]
|
||||
* on the current subject of the assertion.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T, R> Expect<T>.feature(f: KFunction1<T, R>): FeatureExpect<T, R> =
|
||||
ExpectImpl.feature.f0(this, f).getExpectOfFeature()
|
||||
@@ -55,7 +55,7 @@ infix fun <T, R> Expect<T>.feature(f: KFunction1<T, R>): FeatureExpect<T, R> =
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
//TODO remove `in` with Kotlin 1.4 (most likely with Atrium 1.0.0)
|
||||
infix fun <T, R> Expect<T>.feature(of: Feature<in T, R>): FeatureExpect<T, R> =
|
||||
@@ -80,7 +80,7 @@ infix fun <T, R> Expect<T>.feature(of: Feature<in T, R>): FeatureExpect<T, R> =
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] in case the created [AssertionGroup] does not hold.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
//TODO remove `in` with Kotlin 1.4 (most likely with Atrium 1.0.0)
|
||||
infix fun <T, R> Expect<T>.feature(of: FeatureWithCreator<in T, R>): Expect<T> =
|
||||
@@ -99,7 +99,7 @@ infix fun <T, R> Expect<T>.feature(of: FeatureWithCreator<in T, R>): Expect<T> =
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T, R> Expect<T>.feature(provider: MetaFeatureOption<T>.(T) -> MetaFeature<R>): FeatureExpect<T, R> =
|
||||
ExpectImpl.feature.genericSubjectBasedFeature(this) { MetaFeatureOption(this).provider(it) }.getExpectOfFeature()
|
||||
@@ -132,7 +132,7 @@ infix fun <T, R> Expect<T>.feature(provider: MetaFeatureOption<T>.(T) -> MetaFea
|
||||
* e.g. `feature of({ f(it::size) }) { o toBe 3 }`
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T, R> Expect<T>.feature(of: MetaFeatureOptionWithCreator<T, R>): Expect<T> =
|
||||
ExpectImpl.feature.genericSubjectBasedFeature(this) {
|
||||
|
||||
@@ -56,7 +56,7 @@ object group : Keyword
|
||||
* Represents the pseudo keyword `not` as in [contains] `not`.
|
||||
* It can be used for a parameter less function so that it has one parameter and thus can be used as infix function.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
object not : Keyword
|
||||
|
||||
@@ -67,7 +67,7 @@ object not : Keyword
|
||||
*
|
||||
* It can be used for a parameter less function so that it has one parameter and thus can be used as infix function.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
object o : Keyword
|
||||
|
||||
@@ -77,7 +77,7 @@ object o : Keyword
|
||||
* In case you want to refer to the pseudo-keyword `o` inside an [Expect] context,
|
||||
* then you can use this type alias instead to circumvent the bug.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
typealias O = o
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ infix fun <T : Throwable> Expect<T>.messageContains(values: Values<Any>): Expect
|
||||
* @return The newly created [Expect] for the property [Throwable.cause] of the subject of the assertion
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
@Suppress("RemoveExplicitTypeArguments")
|
||||
inline fun <reified TExpected : Throwable> Expect<out Throwable>.cause(): Expect<TExpected> =
|
||||
@@ -74,7 +74,7 @@ inline fun <reified TExpected : Throwable> Expect<out Throwable>.cause(): Expect
|
||||
* @return This assertion container to support a fluent API.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
@Suppress("RemoveExplicitTypeArguments")
|
||||
inline infix fun <reified TExpected : Throwable> Expect<out Throwable>.cause(
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.time.chrono.ChronoLocalDate
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ChronoLocalDate> Expect<T>.isBefore(expected: ChronoLocalDate): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDate.isBefore(this, expected))
|
||||
@@ -26,7 +26,7 @@ infix fun <T : ChronoLocalDate> Expect<T>.isBefore(expected: ChronoLocalDate): E
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ChronoLocalDate> Expect<T>.isBeforeOrEqual(expected: ChronoLocalDate): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDate.isBeforeOrEquals(this, expected))
|
||||
@@ -39,7 +39,7 @@ infix fun <T : ChronoLocalDate> Expect<T>.isBeforeOrEqual(expected: ChronoLocalD
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ChronoLocalDate> Expect<T>.isAfter(expected: ChronoLocalDate): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDate.isAfter(this, expected))
|
||||
@@ -51,7 +51,7 @@ infix fun <T : ChronoLocalDate> Expect<T>.isAfter(expected: ChronoLocalDate): Ex
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ChronoLocalDate> Expect<T>.isAfterOrEqual(expected: ChronoLocalDate): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDate.isAfterOrEquals(this, expected))
|
||||
@@ -63,7 +63,7 @@ infix fun <T : ChronoLocalDate> Expect<T>.isAfterOrEqual(expected: ChronoLocalDa
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ChronoLocalDate> Expect<T>.isEqual(expected: ChronoLocalDate): Expect<T> =
|
||||
addAssertion(ExpectImpl.chronoLocalDate.isEqual(this, expected))
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.time.chrono.ChronoZonedDateTime
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
@@ -28,7 +28,7 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBefore(
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqual(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
@@ -41,7 +41,7 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isBeforeOrEqu
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
@@ -54,7 +54,7 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfter(
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqual(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
@@ -67,7 +67,7 @@ infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isAfterOrEqua
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ChronoZonedDateTime<out ChronoLocalDate>> Expect<T>.isEqual(
|
||||
expected: ChronoZonedDateTime<*>
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.nio.file.Path
|
||||
*
|
||||
* @return The newly created [Expect] for the transformed subject.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
fun <T : File> Expect<T>.asPath(): Expect<Path> =
|
||||
ExpectImpl.changeSubject(this).unreported { it.toPath() }
|
||||
@@ -29,7 +29,7 @@ fun <T : File> Expect<T>.asPath(): Expect<Path> =
|
||||
*
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : File> Expect<T>.asPath(assertionCreator: Expect<Path>.() -> Unit): Expect<T> =
|
||||
apply { asPath().addAssertionsCreatedBy(assertionCreator) }
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.time.LocalDate
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : LocalDate> Expect<T>.year: Expect<Int>
|
||||
get() = ExpectImpl.localDate.year(this).getExpectOfFeature()
|
||||
@@ -30,7 +30,7 @@ val <T : LocalDate> Expect<T>.year: Expect<Int>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : LocalDate> Expect<T>.year(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDate.year(this).addToInitial(assertionCreator)
|
||||
@@ -41,7 +41,7 @@ infix fun <T : LocalDate> Expect<T>.year(assertionCreator: Expect<Int>.() -> Uni
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : LocalDate> Expect<T>.month: Expect<Int>
|
||||
get() = ExpectImpl.localDate.month(this).getExpectOfFeature()
|
||||
@@ -54,7 +54,7 @@ val <T : LocalDate> Expect<T>.month: Expect<Int>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : LocalDate> Expect<T>.month(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDate.month(this).addToInitial(assertionCreator)
|
||||
@@ -65,7 +65,7 @@ infix fun <T : LocalDate> Expect<T>.month(assertionCreator: Expect<Int>.() -> Un
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : LocalDate> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
get() = ExpectImpl.localDate.dayOfWeek(this).getExpectOfFeature()
|
||||
@@ -78,7 +78,7 @@ val <T : LocalDate> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : LocalDate> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDate.dayOfWeek(this).addToInitial(assertionCreator)
|
||||
@@ -90,7 +90,7 @@ infix fun <T : LocalDate> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : LocalDate> Expect<T>.day: Expect<Int>
|
||||
get() = ExpectImpl.localDate.day(this).getExpectOfFeature()
|
||||
@@ -103,7 +103,7 @@ val <T : LocalDate> Expect<T>.day: Expect<Int>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : LocalDate> Expect<T>.day(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDate.day(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.time.LocalDateTime
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : LocalDateTime> Expect<T>.year: Expect<Int>
|
||||
get() = ExpectImpl.localDateTime.year(this).getExpectOfFeature()
|
||||
@@ -30,7 +30,7 @@ val <T : LocalDateTime> Expect<T>.year: Expect<Int>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : LocalDateTime> Expect<T>.year(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDateTime.year(this).addToInitial(assertionCreator)
|
||||
@@ -41,7 +41,7 @@ infix fun <T : LocalDateTime> Expect<T>.year(assertionCreator: Expect<Int>.() ->
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : LocalDateTime> Expect<T>.month: Expect<Int>
|
||||
get() = ExpectImpl.localDateTime.month(this).getExpectOfFeature()
|
||||
@@ -54,7 +54,7 @@ val <T : LocalDateTime> Expect<T>.month: Expect<Int>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : LocalDateTime> Expect<T>.month(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDateTime.month(this).addToInitial(assertionCreator)
|
||||
@@ -65,7 +65,7 @@ infix fun <T : LocalDateTime> Expect<T>.month(assertionCreator: Expect<Int>.() -
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : LocalDateTime> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
get() = ExpectImpl.localDateTime.dayOfWeek(this).getExpectOfFeature()
|
||||
@@ -78,7 +78,7 @@ val <T : LocalDateTime> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : LocalDateTime> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDateTime.dayOfWeek(this).addToInitial(assertionCreator)
|
||||
@@ -89,7 +89,7 @@ infix fun <T : LocalDateTime> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOf
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : LocalDateTime> Expect<T>.day: Expect<Int>
|
||||
get() = ExpectImpl.localDateTime.day(this).getExpectOfFeature()
|
||||
@@ -102,7 +102,7 @@ val <T : LocalDateTime> Expect<T>.day: Expect<Int>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : LocalDateTime> Expect<T>.day(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.localDateTime.day(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.nio.file.Path
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.startsWith(expected: Path): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.startsWith(this, expected))
|
||||
@@ -24,7 +24,7 @@ infix fun <T : Path> Expect<T>.startsWith(expected: Path): Expect<T> =
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.startsNotWith(expected: Path): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.startsNotWith(this, expected))
|
||||
@@ -35,7 +35,7 @@ infix fun <T : Path> Expect<T>.startsNotWith(expected: Path): Expect<T> =
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.endsWith(expected: Path): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.endsWith(this, expected))
|
||||
@@ -47,7 +47,7 @@ infix fun <T : Path> Expect<T>.endsWith(expected: Path): Expect<T> =
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.endsNotWith(expected: Path): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.endsNotWith(this, expected))
|
||||
@@ -62,7 +62,7 @@ infix fun <T : Path> Expect<T>.endsNotWith(expected: Path): Expect<T> =
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.to(@Suppress("UNUSED_PARAMETER") exist: exist): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.exists(this))
|
||||
@@ -77,7 +77,7 @@ infix fun <T : Path> Expect<T>.to(@Suppress("UNUSED_PARAMETER") exist: exist): E
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.notTo(@Suppress("UNUSED_PARAMETER") exist: exist): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.existsNot(this))
|
||||
@@ -89,7 +89,7 @@ infix fun <T : Path> Expect<T>.notTo(@Suppress("UNUSED_PARAMETER") exist: exist)
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : Path> Expect<T>.fileName: Expect<String>
|
||||
get() = ExpectImpl.path.fileName(this).getExpectOfFeature()
|
||||
@@ -103,7 +103,7 @@ val <T : Path> Expect<T>.fileName: Expect<String>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.fileName(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.path.fileName(this).addToInitial(assertionCreator)
|
||||
@@ -116,7 +116,7 @@ infix fun <T : Path> Expect<T>.fileName(assertionCreator: Expect<String>.() -> U
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : Path> Expect<T>.fileNameWithoutExtension: Expect<String>
|
||||
get() = ExpectImpl.path.fileNameWithoutExtension(this).getExpectOfFeature()
|
||||
@@ -130,7 +130,7 @@ val <T : Path> Expect<T>.fileNameWithoutExtension: Expect<String>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.fileNameWithoutExtension(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.path.fileNameWithoutExtension(this).addToInitial(assertionCreator)
|
||||
@@ -142,7 +142,7 @@ infix fun <T : Path> Expect<T>.fileNameWithoutExtension(assertionCreator: Expect
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : Path> Expect<T>.parent: Expect<Path>
|
||||
get() = ExpectImpl.path.parent(this).getExpectOfFeature()
|
||||
@@ -154,7 +154,7 @@ val <T : Path> Expect<T>.parent: Expect<Path>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.path.parent(this).addToInitial(assertionCreator)
|
||||
@@ -166,7 +166,7 @@ infix fun <T : Path> Expect<T>.parent(assertionCreator: Expect<Path>.() -> Unit)
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.resolve(other: String): Expect<Path> =
|
||||
ExpectImpl.path.resolve(this, other).getExpectOfFeature()
|
||||
@@ -187,7 +187,7 @@ infix fun <T : Path> Expect<T>.resolve(other: String): Expect<Path> =
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") readable: readable): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.isReadable(this))
|
||||
@@ -204,7 +204,7 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") readable: read
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") writable: writable): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.isWritable(this))
|
||||
@@ -224,7 +224,7 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") writable: writ
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aRegularFile: aRegularFile): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.isRegularFile(this))
|
||||
@@ -244,7 +244,7 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aRegularFile:
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aDirectory: aDirectory): Expect<T> =
|
||||
addAssertion(ExpectImpl.path.isDirectory(this))
|
||||
@@ -256,7 +256,7 @@ infix fun <T : Path> Expect<T>.toBe(@Suppress("UNUSED_PARAMETER") aDirectory: aD
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : Path> Expect<T>.extension: Expect<String>
|
||||
get() = ExpectImpl.path.extension(this).getExpectOfFeature()
|
||||
@@ -270,7 +270,7 @@ val <T : Path> Expect<T>.extension: Expect<String>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : Path> Expect<T>.extension(assertionCreator: Expect<String>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.path.extension(this).addToInitial(assertionCreator)
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.time.ZonedDateTime
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : ZonedDateTime> Expect<T>.year: Expect<Int>
|
||||
get() = ExpectImpl.zonedDateTime.year(this).getExpectOfFeature()
|
||||
@@ -30,7 +30,7 @@ val <T : ZonedDateTime> Expect<T>.year: Expect<Int>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ZonedDateTime> Expect<T>.year(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.zonedDateTime.year(this).addToInitial(assertionCreator)
|
||||
@@ -41,7 +41,7 @@ infix fun <T : ZonedDateTime> Expect<T>.year(assertionCreator: Expect<Int>.() ->
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : ZonedDateTime> Expect<T>.month: Expect<Int>
|
||||
get() = ExpectImpl.zonedDateTime.month(this).getExpectOfFeature()
|
||||
@@ -54,7 +54,7 @@ val <T : ZonedDateTime> Expect<T>.month: Expect<Int>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ZonedDateTime> Expect<T>.month(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.zonedDateTime.month(this).addToInitial(assertionCreator)
|
||||
@@ -65,7 +65,7 @@ infix fun <T : ZonedDateTime> Expect<T>.month(assertionCreator: Expect<Int>.() -
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : ZonedDateTime> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
get() = ExpectImpl.zonedDateTime.dayOfWeek(this).getExpectOfFeature()
|
||||
@@ -78,7 +78,7 @@ val <T : ZonedDateTime> Expect<T>.dayOfWeek: Expect<DayOfWeek>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ZonedDateTime> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOfWeek>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.zonedDateTime.dayOfWeek(this).addToInitial(assertionCreator)
|
||||
@@ -89,7 +89,7 @@ infix fun <T : ZonedDateTime> Expect<T>.dayOfWeek(assertionCreator: Expect<DayOf
|
||||
*
|
||||
* @return The newly created [Expect] for the extracted feature.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
val <T : ZonedDateTime> Expect<T>.day: Expect<Int>
|
||||
get() = ExpectImpl.zonedDateTime.day(this).getExpectOfFeature()
|
||||
@@ -102,7 +102,7 @@ val <T : ZonedDateTime> Expect<T>.day: Expect<Int>
|
||||
* @return An [Expect] for the current subject of the assertion.
|
||||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct.
|
||||
*
|
||||
* @since 0.10.0
|
||||
* @since 0.11.0
|
||||
*/
|
||||
infix fun <T : ZonedDateTime> Expect<T>.day(assertionCreator: Expect<Int>.() -> Unit): Expect<T> =
|
||||
ExpectImpl.zonedDateTime.day(this).addToInitial(assertionCreator)
|
||||
|
||||
Reference in New Issue
Block a user