Class BreakableIteratorTest
java.lang.Object
org.soliscode.test.breakable.BreakableIteratorTest
Tests for the
BreakableIterator
class. These tests determine if the breaks supported by this class result in the
behavior expected.- Since:
- 1.0
- Author:
- evanbergstrom
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Test that theITERATOR_FOR_EACH_REMAINING_DOES_NOT_CALL_ACTION
break causes theforEachRemaining
method to not call the action on any elements.void
Test that theITERATOR_IS_ALWAYS_EMPTY
break causes the iterator not iterate over any elements.void
Test that theITERATOR_HAS_NEXT_ALWAYS_RETURNS_FALSE
break causes thehasNext
method to always returnfalse
.void
Test that theITERATOR_HAS_NEXT_ALWAYS_RETURNS_TRUE
break causes thehasNext
method to always returntrue
.void
Test that theITERATOR_HAS_NEXT_RETURNS_OPPOSITE_VALUE
break causes thehasNext
method to return the opposite value..void
Test that theITERATOR_NEXT_ALWAYS_RETURNS_NULL
break causes thenext
method to always returnnull
void
Test that theITERATOR_NEXT_THROWS_WRONG_EXCEPTION
break causes thenext
method to always returnnull
void
Test that theITERATOR_REMOVE_DOES_NOT_REMOVE_ELEMENT
break causes theremove
method to not remove the element at the iterators current position.void
Test that theITERATOR_SKIPS_FIRST_ELEMENT
break causes the iterator to skip over the first element.
-
Constructor Details
-
BreakableIteratorTest
public BreakableIteratorTest()
-
-
Method Details
-
testIteratorWithAlwaysEmptyBreak
@Test @DisplayName("Test the iterator with the ITERATOR_IS_ALWAYS_EMPTY break") public void testIteratorWithAlwaysEmptyBreak()Test that theITERATOR_IS_ALWAYS_EMPTY
break causes the iterator not iterate over any elements.- See Also:
-
testIteratorWithSkipsFirstElementBreak
@Test @DisplayName("Test the iterator with the ITERATOR_SKIPS_FIRST_ELEMENT break") public void testIteratorWithSkipsFirstElementBreak()Test that theITERATOR_SKIPS_FIRST_ELEMENT
break causes the iterator to skip over the first element.- See Also:
-
testIteratorWithHasNextAlwaysReturnsTrue
@Test @DisplayName("Test the `hasNext` method with the ITERATOR_HAS_NEXT_ALWAYS_RETURNS_TRUE break") public void testIteratorWithHasNextAlwaysReturnsTrue()Test that theITERATOR_HAS_NEXT_ALWAYS_RETURNS_TRUE
break causes thehasNext
method to always returntrue
.- See Also:
-
testIteratorWithHasNextAlwaysReturnsFalseBreak
@DisplayName("Test the `hasNext` method with the ITERATOR_HAS_NEXT_ALWAYS_RETURNS_FALSE break") @Test public void testIteratorWithHasNextAlwaysReturnsFalseBreak()Test that theITERATOR_HAS_NEXT_ALWAYS_RETURNS_FALSE
break causes thehasNext
method to always returnfalse
.- See Also:
-
testIteratorWithHasNextReturnsOppositeValueBreak
@Test @DisplayName("Test the `hasNext` method with the ITERATOR_HAS_NEXT_RETURNS_OPPOSITE_VALUE break") public void testIteratorWithHasNextReturnsOppositeValueBreak()Test that theITERATOR_HAS_NEXT_RETURNS_OPPOSITE_VALUE
break causes thehasNext
method to return the opposite value..- See Also:
-
testIteratorWithNextAlwaysReturnsNullBreak
@DisplayName("Test the `next` method with the ITERATOR_NEXT_ALWAYS_RETURNS_NULL break") @Test public void testIteratorWithNextAlwaysReturnsNullBreak()Test that theITERATOR_NEXT_ALWAYS_RETURNS_NULL
break causes thenext
method to always returnnull
- See Also:
-
testIteratorWithNextThrowsWrongExceptionBreak
@Test @DisplayName("Test the `next` method with the ITERATOR_NEXT_THROWS_WRONG_EXCEPTION break") public void testIteratorWithNextThrowsWrongExceptionBreak()Test that theITERATOR_NEXT_THROWS_WRONG_EXCEPTION
break causes thenext
method to always returnnull
- See Also:
-
testIteratorWithRemoveDoesNotRemoveElementBreak
@Test @DisplayName("Test the `remove` method with the ITERATOR_REMOVE_DOES_NOT_REMOVE_ELEMENT break") public void testIteratorWithRemoveDoesNotRemoveElementBreak()Test that theITERATOR_REMOVE_DOES_NOT_REMOVE_ELEMENT
break causes theremove
method to not remove the element at the iterators current position.- See Also:
-
testIteratorForEachRemainingWithDoesNotCallActionBreak
@Test @DisplayName("Test the `forEachRemaining` method with the ITERATOR_FOR_EACH_REMAINING_DOES_NOT_CALL_ACTION break") public void testIteratorForEachRemainingWithDoesNotCallActionBreak()Test that theITERATOR_FOR_EACH_REMAINING_DOES_NOT_CALL_ACTION
break causes theforEachRemaining
method to not call the action on any elements.- See Also:
-