jvmMain.ch.tutteli.atrium.api.fluent.en_GB.chronoZonedDateTimeExpectations.kt Maven / Gradle / Ivy
package ch.tutteli.atrium.api.fluent.en_GB
import ch.tutteli.atrium.creating.Expect
import ch.tutteli.atrium.creating.PleaseUseReplacementException
import ch.tutteli.atrium.logic.*
import java.time.chrono.ChronoLocalDate
import java.time.chrono.ChronoZonedDateTime
/**
* Expects that the subject of `this` expectation (a [ChronoZonedDateTime])
* is before the [expected] [ChronoZonedDateTime].
*
* @return an [Expect] for the subject of `this` expectation.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoZonedDateTimeExpectationSamples.toBeBeforeChronoZonedDateTime
*
* @since 0.17.0
*/
fun > Expect.toBeBefore(
expected: ChronoZonedDateTime<*>
): Expect = _logicAppend { isBefore(expected) }
/**
* Expects that the subject of `this` expectation (a [ChronoZonedDateTime])
* is before the [expected] [ChronoZonedDateTime] given as [String].
*
* The format is composed of {DateTime}{ZoneDesignator}.
*
* DateTime:
* - yyyy-mm-ddThh:mm:ss.SSS (up to 9 digits for nanoseconds)
* - yyyy-mm-ddThh:mm:ss
* - yyyy-mm-ddThh:mm
* - yyyy-mm-dd
*
* And for ZoneDesignator:
* - Z
* - +hh
* - +hh:mm
* - -hh
* - -hh:mm
*
* Here are some examples on how it can look combined
* - 2020-01-02T03:04:05Z
* - 2020-01-02T03:04Z
* - 2020-01-02Z
* - 2020-01-02+01:30
*
* @return an [Expect] for the subject of `this` expectation.
* @throws [java.time.DateTimeException] in case an unsupported format is given.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoZonedDateTimeExpectationSamples.toBeBeforeString
*
* @since 0.17.0
*/
fun > Expect.toBeBefore(
expected: String
): Expect = _logicAppend { isBefore(expected) }
/**
* Expects that the subject of `this` expectation (a [ChronoZonedDateTime])
* is before or equals the [expected] [ChronoZonedDateTime].
*
* @return an [Expect] for the subject of `this` expectation.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoZonedDateTimeExpectationSamples.toBeBeforeOrTheSamePointInTimeAsChronoZonedDateTime
*
* @since 0.17.0
*/
fun > Expect.toBeBeforeOrTheSamePointInTimeAs(
expected: ChronoZonedDateTime<*>
): Expect = _logicAppend { isBeforeOrEqual(expected) }
/**
* Expects that the subject of `this` expectation (a [ChronoZonedDateTime])
* is before or equals the [expected] [ChronoZonedDateTime] given as [String].
*
* The format is composed of {DateTime}{ZoneDesignator}.
*
* DateTime:
* - yyyy-mm-ddThh:mm:ss.SSS (up to 9 digits for nanoseconds)
* - yyyy-mm-ddThh:mm:ss
* - yyyy-mm-ddThh:mm
* - yyyy-mm-dd
*
* And for ZoneDesignator:
* - Z
* - +hh
* - +hh:mm
* - -hh
* - -hh:mm
*
* Here are some examples on how it can look combined
* - 2020-01-02T03:04:05Z
* - 2020-01-02T03:04Z
* - 2020-01-02Z
* - 2020-01-02+01:30
*
* @return an [Expect] for the subject of `this` expectation.
* @throws [java.time.DateTimeException] in case an unsupported format is given.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoZonedDateTimeExpectationSamples.toBeBeforeOrTheSamePointInTimeAsString
*
* @since 0.17.0
*/
fun > Expect.toBeBeforeOrTheSamePointInTimeAs(
expected: String
): Expect = _logicAppend { isBeforeOrEqual(expected) }
/**
* Expects that the subject of `this` expectation (a [ChronoZonedDateTime])
* is equal to the [expected] [ChronoZonedDateTime].
*
* @return an [Expect] for the subject of `this` expectation.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoZonedDateTimeExpectationSamples.toBeTheSamePointInTimeAsChronoZonedDateTime
*
* @since 0.17.0
*/
fun > Expect.toBeTheSamePointInTimeAs(
expected: ChronoZonedDateTime<*>
): Expect = _logicAppend { isEqual(expected) }
/**
* Expects that the subject of `this` expectation (a [ChronoZonedDateTime])
* is equal to the [expected] [ChronoZonedDateTime] given as [String].
*
* The format is composed of {DateTime}{ZoneDesignator}.
*
* DateTime:
* - yyyy-mm-ddThh:mm:ss.SSS (up to 9 digits for nanoseconds)
* - yyyy-mm-ddThh:mm:ss
* - yyyy-mm-ddThh:mm
* - yyyy-mm-dd
*
* And for ZoneDesignator:
* - Z
* - +hh
* - +hh:mm
* - -hh
* - -hh:mm
*
* Here are some examples on how it can look combined
* - 2020-01-02T03:04:05Z
* - 2020-01-02T03:04Z
* - 2020-01-02Z
* - 2020-01-02+01:30
*
* @return an [Expect] for the subject of `this` expectation.
* @throws [java.time.DateTimeException] in case an unsupported format is given.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoZonedDateTimeExpectationSamples.toBeTheSamePointInTimeAsString
*
* @since 0.17.0
*/
fun > Expect.toBeTheSamePointInTimeAs(
expected: String
): Expect = _logicAppend { isEqual(expected) }
/**
* Expects that the subject of `this` expectation (a [ChronoZonedDateTime])
* is after or equal the [expected] [ChronoZonedDateTime].
*
* @return an [Expect] for the subject of `this` expectation.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoZonedDateTimeExpectationSamples.toBeAfterOrTheSamePointInTimeAsChronoZonedDateTime
*
* @since 0.17.0
*/
fun > Expect.toBeAfterOrTheSamePointInTimeAs(
expected: ChronoZonedDateTime<*>
): Expect = _logicAppend { isAfterOrEqual(expected) }
/**
* Expects that the subject of `this` expectation (a [ChronoZonedDateTime])
* is after or equal the [expected] [ChronoZonedDateTime] given as [String].
*
* The format is composed of {DateTime}{ZoneDesignator}.
*
* DateTime:
* - yyyy-mm-ddThh:mm:ss.SSS (up to 9 digits for nanoseconds)
* - yyyy-mm-ddThh:mm:ss
* - yyyy-mm-ddThh:mm
* - yyyy-mm-dd
*
* And for ZoneDesignator:
* - Z
* - +hh
* - +hh:mm
* - -hh
* - -hh:mm
*
* Here are some examples on how it can look combined
* - 2020-01-02T03:04:05Z
* - 2020-01-02T03:04Z
* - 2020-01-02Z
* - 2020-01-02+01:30
*
* @return an [Expect] for the subject of `this` expectation.
* @throws [java.time.DateTimeException] in case an unsupported format is given.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoZonedDateTimeExpectationSamples.toBeAfterOrTheSamePointInTimeAsString
*
* @since 0.17.0
*/
fun > Expect.toBeAfterOrTheSamePointInTimeAs(
expected: String
): Expect = _logicAppend { isAfterOrEqual(expected) }
/**
* Expects that the subject of `this` expectation (a [ChronoZonedDateTime])
* is after the [expected] [ChronoZonedDateTime].
*
* @return an [Expect] for the subject of `this` expectation.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoZonedDateTimeExpectationSamples.toBeAfterChronoZonedDateTime
*
* @since 0.17.0
*/
fun > Expect.toBeAfter(
expected: ChronoZonedDateTime<*>
): Expect = _logicAppend { isAfter(expected) }
/**
* Expects that the subject of `this` expectation (a [ChronoZonedDateTime])
* is after the [expected] [ChronoZonedDateTime] given as [String].
*
* The format is composed of {DateTime}{ZoneDesignator}.
*
* DateTime:
* - yyyy-mm-ddThh:mm:ss.SSS (up to 9 digits for nanoseconds)
* - yyyy-mm-ddThh:mm:ss
* - yyyy-mm-ddThh:mm
* - yyyy-mm-dd
*
* And for ZoneDesignator:
* - Z
* - +hh
* - +hh:mm
* - -hh
* - -hh:mm
*
* Here are some examples on how it can look combined
* - 2020-01-02T03:04:05Z
* - 2020-01-02T03:04Z
* - 2020-01-02Z
* - 2020-01-02+01:30
*
* @return an [Expect] for the subject of `this` expectation.
* @throws [java.time.DateTimeException] in case an unsupported format is given.
*
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoZonedDateTimeExpectationSamples.toBeAfterString
*
* @since 0.17.0
*/
fun > Expect.toBeAfter(
expected: String
): Expect = _logicAppend { isAfter(expected) }
/**
* Deprecated overload which shall help users to use [toBeBefore] instead.
*
* @since 1.0.0
*/
@Suppress("UNUSED_PARAMETER", "UnusedReceiverParameter")
@Deprecated(
"'toBeLessThan' is deprecated in favour of 'toBeBefore' which is based on ChronoZonedDateTime.isBefore instead of compareTo",
ReplaceWith("toBeBefore(expected)")
)
fun > Expect.toBeLessThan(expected: T): Nothing =
throw PleaseUseReplacementException(
"'toBeLessThan' is deprecated in favour of 'toBeBefore', use a feature extractor if you want to base your expectation on compareTo"
)
/**
* Deprecated overload which shall help users to use [toBeBeforeOrTheSamePointInTimeAs] instead.
*
* @since 1.0.0
*/
@Suppress("UNUSED_PARAMETER", "UnusedReceiverParameter")
@Deprecated(
"'toBeLessThanOrEqualTo is deprecated in favour of 'toBeBeforeOrTheSamePointInTimeAs' which is based on ChronoZonedDateTime.isBefore and ChronoZonedDateTime.isEqual instead of compareTo",
ReplaceWith("toBeBeforeOrTheSamePointInTimeAs(expected)")
)
fun > Expect.toBeLessThanOrEqualTo(expected: T): Nothing =
throw PleaseUseReplacementException(
"'toBeLessThanOrEqualTo is deprecated in favour of 'toBeBeforeOrTheSamePointInTimeAs', use a feature extractor if you want to base your expectation on compareTo"
)
/**
* Deprecated overload which shall help users to use [notToBeGreaterThan] instead.
*
* @since 1.0.0
*/
@Suppress("UNUSED_PARAMETER", "UnusedReceiverParameter")
@Deprecated(
"'notToBeGreaterThan' is deprecated in favour of 'toBeBeforeOrTheSamePointInTimeAs' which is based on ChronoZonedDateTime.isBefore and ChronoZonedDateTime.isEqual instead of compareTo",
ReplaceWith("toBeBeforeOrTheSamePointInTimeAs(expected)")
)
fun > Expect.notToBeGreaterThan(expected: T): Nothing =
throw PleaseUseReplacementException(
"'notToBeGreaterThan' is deprecated in favour of 'toBeBeforeOrTheSamePointInTimeAs', use a feature extractor if you want to base your expectation on compareTo"
)
/**
* Deprecated overload which shall help users to use [toBeTheSamePointInTimeAs] instead.
*
* @since 1.0.0
*/
@Suppress("UNUSED_PARAMETER", "UnusedReceiverParameter")
@Deprecated(
"'toBeEqualComparingTo' is deprecated in favour of 'toBeTheSamePointInTimeAs' which is based on ChronoZonedDateTime.isEqual instead of compareTo",
ReplaceWith("toBeTheSamePointInTimeAs(expected)")
)
fun > Expect.toBeEqualComparingTo(expected: T): Nothing =
throw PleaseUseReplacementException(
"'toBeEqualComparingTo' is deprecated in favour of 'toBeTheSamePointInTimeAs', use a feature extractor if you want to base your expectation on compareTo"
)
/**
* Deprecated overload which shall help users to use [toBeAfterOrTheSamePointInTimeAs] instead.
*
* @since 1.0.0
*/
@Suppress("UNUSED_PARAMETER", "UnusedReceiverParameter")
@Deprecated(
"'toBeGreaterThanOrEqualTo' is deprecated in favour of 'toBeAfterOrTheSamePointInTimeAs' which is based on ChronoZonedDateTime.isAfter and ChronoZonedDateTime.isEqual instead of compareTo",
ReplaceWith("toBeAfterOrTheSamePointInTimeAs(expected)")
)
fun > Expect.toBeGreaterThanOrEqualTo(expected: T): Nothing =
throw PleaseUseReplacementException(
"'toBeGreaterThanOrEqualTo' is deprecated in favour of 'toBeAfterOrTheSamePointInTimeAs', use a feature extractor if you want to base your expectation on compareTo"
)
/**
* Deprecated overload which shall help users to use [toBeAfterOrTheSamePointInTimeAs] instead.
*
* @since 1.0.0
*/
@Suppress("UNUSED_PARAMETER", "UnusedReceiverParameter")
@Deprecated(
"'notToBeLessThan' is deprecated in favour of 'toBeAfterOrTheSamePointInTimeAs' which is based on ChronoZonedDateTime.isAfter and ChronoZonedDateTime.isEqual instead of compareTo",
ReplaceWith("toBeAfterOrTheSamePointInTimeAs(expected)")
)
fun > Expect.notToBeLessThan(expected: T): Nothing =
throw PleaseUseReplacementException(
"'notToBeLessThan' is deprecated in favour of 'toBeAfterOrTheSamePointInTimeAs', use a feature extractor if you want to base your expectation on compareTo"
)
/**
* Deprecated overload which shall help users to use [toBeAfter] instead.
*
* @since 1.0.0
*/
@Suppress("UNUSED_PARAMETER", "UnusedReceiverParameter")
@Deprecated(
"'toBeGreaterThan' is deprecated in favour of 'toBeAfter' which is based on ChronoZonedDateTime.isAfter instead of compareTo",
ReplaceWith("toBeAfter(expected)")
)
fun > Expect.toBeGreaterThan(expected: T): Nothing =
throw PleaseUseReplacementException(
"'toBeGreaterThan' is deprecated in favour of 'toBeAfter', use a feature extractor if you want to base your expectation on compareTo"
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy