diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateExpectations.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateExpectations.kt index 3dcdf6404..313e4e0b2 100644 --- a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateExpectations.kt +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateExpectations.kt @@ -15,6 +15,8 @@ import java.time.chrono.ChronoLocalDate * * @return an [Expect] for the subject of `this` expectation. * + * @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoLocalDateExpectationSamples.toBeBeforeChronoLocalDate + * * @since 0.17.0 */ fun Expect.toBeBefore(expected: ChronoLocalDate): Expect = @@ -27,6 +29,8 @@ fun Expect.toBeBefore(expected: ChronoLocalDate): Expec * @return an [Expect] for the subject of `this` expectation. * @throws [java.time.DateTimeException] in case [expected] is not in the form of **yyyy-mm-dd** * + * @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoLocalDateExpectationSamples.toBeBeforeString + * * @since 0.17.0 */ fun Expect.toBeBefore(expected: String): Expect = @@ -39,6 +43,8 @@ fun Expect.toBeBefore(expected: String): Expect = * * @return an [Expect] for the subject of `this` expectation. * + * @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoLocalDateExpectationSamples.toBeBeforeOrTheSamePointInTimeAsChronoLocalDate + * * @since 0.17.0 */ fun Expect.toBeBeforeOrTheSamePointInTimeAs(expected: ChronoLocalDate): Expect = @@ -51,6 +57,8 @@ fun Expect.toBeBeforeOrTheSamePointInTimeAs(expected: C * @return an [Expect] for the subject of `this` expectation. * @throws [java.time.DateTimeException] in case [expected] is not in the form of **yyyy-mm-dd** * + * @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoLocalDateExpectationSamples.toBeBeforeOrTheSamePointInTimeAsString + * * @since 0.17.0 */ fun Expect.toBeBeforeOrTheSamePointInTimeAs(expected: String): Expect = @@ -63,6 +71,8 @@ fun Expect.toBeBeforeOrTheSamePointInTimeAs(expected: S * * @return an [Expect] for the subject of `this` expectation. * + * @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoLocalDateExpectationSamples.toBeTheSamePointInTimeAsChronoLocalDate + * * @since 0.17.0 */ fun Expect.toBeTheSamePointInTimeAs(expected: ChronoLocalDate): Expect = @@ -75,6 +85,8 @@ fun Expect.toBeTheSamePointInTimeAs(expected: ChronoLoc * @return an [Expect] for the subject of `this` expectation. * @throws [java.time.DateTimeException] in case [expected] is not in the form of **yyyy-mm-dd** * + * @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoLocalDateExpectationSamples.toBeTheSamePointInTimeAsString + * * @since 0.17.0 */ fun Expect.toBeTheSamePointInTimeAs(expected: String): Expect = @@ -86,6 +98,8 @@ fun Expect.toBeTheSamePointInTimeAs(expected: String): * * @return an [Expect] for the subject of `this` expectation. * + * @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoLocalDateExpectationSamples.toBeAfterOrTheSamePointInTimeAsChronoLocalDate + * * @since 0.17.0 */ fun Expect.toBeAfterOrTheSamePointInTimeAs(expected: ChronoLocalDate): Expect = @@ -98,6 +112,8 @@ fun Expect.toBeAfterOrTheSamePointInTimeAs(expected: Ch * @return an [Expect] for the subject of `this` expectation. * @throws [java.time.DateTimeException] in case [expected] is not in the form of **yyyy-mm-dd** * + * @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoLocalDateExpectationSamples.toBeAfterOrTheSamePointInTimeAsString + * * @since 0.17.0 */ fun Expect.toBeAfterOrTheSamePointInTimeAs(expected: String): Expect = @@ -110,6 +126,8 @@ fun Expect.toBeAfterOrTheSamePointInTimeAs(expected: St * * @return an [Expect] for the subject of `this` expectation. * + * @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoLocalDateExpectationSamples.toBeAfterChronoLocalDate + * * @since 0.17.0 */ fun Expect.toBeAfter(expected: ChronoLocalDate): Expect = @@ -122,6 +140,8 @@ fun Expect.toBeAfter(expected: ChronoLocalDate): Expect * @return an [Expect] for the subject of `this` expectation. * @throws [java.time.DateTimeException] in case [expected] is not in the form of **yyyy-mm-dd** * + * @sample ch.tutteli.atrium.api.fluent.en_GB.samples.ChronoLocalDateExpectationSamples.toBeAfterString + * * @since 0.17.0 */ fun Expect.toBeAfter(expected: String): Expect = diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/ChronoLocalDateExpectationSamples.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/ChronoLocalDateExpectationSamples.kt new file mode 100644 index 000000000..d4998ed84 --- /dev/null +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/ChronoLocalDateExpectationSamples.kt @@ -0,0 +1,64 @@ +package ch.tutteli.atrium.api.fluent.en_GB.samples + +import ch.tutteli.atrium.api.fluent.en_GB.* +import ch.tutteli.atrium.api.verbs.internal.expect +import java.time.LocalDate +import java.time.Month +import kotlin.test.Test + +class ChronoLocalDateExpectationSamples { + + @Test + fun toBeBeforeChronoLocalDate() { + expect(LocalDate.of(2021, Month.JUNE, 6)).toBeBefore(LocalDate.of(2021, Month.JULY, 1)) + } + + @Test + fun toBeBeforeString() { + expect(LocalDate.of(2021, Month.JUNE, 6)).toBeBefore("2021-07-01") + } + + @Test + fun toBeBeforeOrTheSamePointInTimeAsChronoLocalDate() { + expect(LocalDate.of(2021, Month.JUNE, 6)).toBeBeforeOrTheSamePointInTimeAs(LocalDate.of(2021, Month.JULY, 1)) + expect(LocalDate.of(2021, Month.JUNE, 6)).toBeBeforeOrTheSamePointInTimeAs(LocalDate.of(2021, Month.JUNE, 6)) + } + + @Test + fun toBeBeforeOrTheSamePointInTimeAsString() { + expect(LocalDate.of(2021, Month.JUNE, 6)).toBeBeforeOrTheSamePointInTimeAs("2021-07-01") + expect(LocalDate.of(2021, Month.JUNE, 6)).toBeBeforeOrTheSamePointInTimeAs("2021-06-06") + } + + @Test + fun toBeTheSamePointInTimeAsChronoLocalDate() { + expect(LocalDate.of(2021, Month.JUNE, 6)).toBeTheSamePointInTimeAs(LocalDate.of(2021, Month.JUNE, 6)) + } + + @Test + fun toBeTheSamePointInTimeAsString() { + expect(LocalDate.of(2021, Month.JUNE, 6)).toBeTheSamePointInTimeAs("2021-06-06") + } + + @Test + fun toBeAfterOrTheSamePointInTimeAsChronoLocalDate() { + expect(LocalDate.of(2021, Month.AUGUST, 6)).toBeAfterOrTheSamePointInTimeAs(LocalDate.of(2021, Month.JULY, 1)) + expect(LocalDate.of(2021, Month.JULY, 1)).toBeAfterOrTheSamePointInTimeAs(LocalDate.of(2021, Month.JULY, 1)) + } + + @Test + fun toBeAfterOrTheSamePointInTimeAsString() { + expect(LocalDate.of(2021, Month.AUGUST, 6)).toBeAfterOrTheSamePointInTimeAs("2021-07-01") + expect(LocalDate.of(2021, Month.JULY, 1)).toBeAfterOrTheSamePointInTimeAs("2021-07-01") + } + + @Test + fun toBeAfterChronoLocalDate() { + expect(LocalDate.of(2021, Month.AUGUST, 6)).toBeAfter(LocalDate.of(2021, Month.JULY, 1)) + } + + @Test + fun toBeAfterString() { + expect(LocalDate.of(2021, Month.AUGUST, 6)).toBeAfter("2021-07-01") + } +}