From effb4066d55be481c38d154b7641db768124131d Mon Sep 17 00:00:00 2001 From: Robert Stoll Date: Sun, 27 Dec 2020 22:03:29 +0100 Subject: [PATCH] adopt comments for IteratorSamples from infix also for fluent --- .../en_GB/samples/IteratorAssertionSamples.kt | 12 ++++++------ .../en_GB/samples/IteratorAssertionSamples.kt | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apis/fluent-en_GB/atrium-api-fluent-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IteratorAssertionSamples.kt b/apis/fluent-en_GB/atrium-api-fluent-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IteratorAssertionSamples.kt index 29b421fc05..f5d03bb181 100644 --- a/apis/fluent-en_GB/atrium-api-fluent-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IteratorAssertionSamples.kt +++ b/apis/fluent-en_GB/atrium-api-fluent-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IteratorAssertionSamples.kt @@ -11,24 +11,24 @@ class IteratorAssertionSamples { fun hasNext() { val list = listOf(1) val iterator = list.iterator() - expect(iterator).hasNext() + expect(iterator).hasNext() // holds as iterator has a next element fails { - iterator.next() - expect(iterator).hasNext() + iterator.next() // returns the next element in iteration + expect(iterator).hasNext() // fails as list has only 1 element, i.e. no next any more. } } @Test fun hasNoNext() { val list = listOf(1) - val iterator = list.iterator() + val iterator = list.iterator() // fails as iterator has a next element (has actually one element) fails { expect(iterator).hasNotNext() } - iterator.next() - expect(iterator).hasNotNext() + iterator.next() // returns the next element in iteration + expect(iterator).hasNotNext() // returns the next element in iteration } } diff --git a/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/IteratorAssertionSamples.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/IteratorAssertionSamples.kt index 75cf14e17e..069e3026a6 100644 --- a/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/IteratorAssertionSamples.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/IteratorAssertionSamples.kt @@ -9,27 +9,27 @@ import kotlin.test.Test class IteratorAssertionSamples { @Test - fun has() { + fun has_next() { val list = listOf(1) val iterator = list.iterator() - expect(iterator) has next //subject is iterator of list + expect(iterator) has next // holds as iterator has a next element fails { - iterator.next() //returns the next element in iteration - expect(iterator) has next //fails as list has only 1 element + iterator.next() // returns the next element in iteration + expect(iterator) has next // fails as list has only 1 element, i.e. no next any more. } } @Test - fun hasNot() { + fun hasNot_next() { val list = listOf(1) val iterator = list.iterator() fails { - expect(iterator) hasNot next //fails as list has one element + expect(iterator) hasNot next // fails as iterator has a next element (has actually one element) } - iterator.next() //returns the next element in iteration - expect(iterator) hasNot next //list has no more elements + iterator.next() // returns the next element in iteration + expect(iterator) hasNot next // list has no more elements thus expectation holds } }