From a621e4d0c7a6148bfa005a9b2821e7ea132b73fa Mon Sep 17 00:00:00 2001 From: Nikos-Tsiougranas Date: Fri, 29 Sep 2023 21:42:10 +0200 Subject: [PATCH] Add samples for Iterable.toContain.exactly --- .../en_GB/iterableLikeToContainCheckers.kt | 2 ++ .../IterableLikeToContainCheckerSamples.kt | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/iterableLikeToContainCheckers.kt b/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/iterableLikeToContainCheckers.kt index 639e4540a8..f387a3da05 100644 --- a/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/iterableLikeToContainCheckers.kt +++ b/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/iterableLikeToContainCheckers.kt @@ -66,6 +66,8 @@ fun AtLeastCheckerStep IterableLikeContains.EntryPointStep.exactly( diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IterableLikeToContainCheckerSamples.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IterableLikeToContainCheckerSamples.kt index 65b206c62f..1148563332 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IterableLikeToContainCheckerSamples.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IterableLikeToContainCheckerSamples.kt @@ -5,6 +5,26 @@ import ch.tutteli.atrium.api.verbs.expect import kotlin.test.Test class IterableLikeToContainCheckerSamples { + @Test + fun exactly() { + expect(listOf("A", "B", "A")).toContain.inAnyOrder.exactly(2).entry { + toEqual("A") + } + expect(listOf(1, 2, 3)).toContain.inAnyOrder.exactly(2).entry { + toBeGreaterThan(1) + } + fails { + expect(listOf("A", "B", "A", "C")).toContain.inAnyOrder.exactly(2).entry { + toEqual("B") + } + } + + fails { + expect(listOf(1, 2, 3)).toContain.inAnyOrder.exactly(2).entry { + toBeLessThanOrEqualTo(1) + } + } + } }