Class BreakableIterableTest
java.lang.Object
org.soliscode.test.OptionalMethodSupport
org.soliscode.test.AbstractTest
org.soliscode.test.breakable.BreakableIterableTest
- All Implemented Interfaces:
CollectionContractConfig
,ForEachContract<Integer,
,BreakableIterable<Integer>> IterableContract<Integer,
,BreakableIterable<Integer>> IteratorContract<Integer,
,BreakableIterable<Integer>> SpliteratorContract<Integer,
,BreakableIterable<Integer>> EqualsContract<BreakableIterable<Integer>>
,HashCodeContract<BreakableIterable<Integer>>
,ObjectContract<BreakableIterable<Integer>>
,ToStringContract<BreakableIterable<Integer>>
,CollectionContractSupport<Integer,
,BreakableIterable<Integer>> CollectionProviderSupport<Integer,
,BreakableIterable<Integer>> ContractSupport<BreakableIterable<Integer>>
,ElementProviderSupport<Integer>
,ProviderSupport<BreakableIterable<Integer>>
,WithIntegerElement
,SupportedMethods
@DisplayName("Tests for BreakableIterable")
public class BreakableIterableTest
extends AbstractTest
implements IterableContract<Integer,BreakableIterable<Integer>>, WithIntegerElement
Tests for the
BreakableIterable
class. These tests determine if the breaks supported by this class result in the
behavior expected.- Since:
- 1.0
- Author:
- evanbergstrom
- See Also:
-
Field Summary
Fields inherited from interface org.soliscode.test.contract.support.CollectionContractSupport
DEFAULT_SIZE
Fields inherited from interface org.soliscode.test.contract.iterable.SpliteratorContract
CHARACTERISTIC_VALUES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull CollectionProvider
<Integer, BreakableIterable<Integer>> provider()
void
void
void
testBuilderSetCharacteristics
(int characteristics) void
Test that theFOR_EACH_DOES_NOT_CALL_ACTION
break causes the iterable to never call the action.void
Test that theFOR_EACH_SKIPS_FIRST_ELEMENT
break causes theforEach
method to skip the first element.void
Test that theFOR_EACH_SKIPS_LAST_ELEMENT
break causes theforEach
method to skip the last element.void
Test that theFOR_EACH_THROWS_WRONG_EXCEPTION_FOR_NULL_ARGUMENT
break causes theforEach
method to throw the wrong exception when the argument isnull
.void
void
Methods inherited from class org.soliscode.test.OptionalMethodSupport
doesNotSupportMethod, supportsMethod, unsupportedMethods
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.soliscode.test.contract.CollectionContractConfig
permitDuplicates, permitIncompatibleTypes, permitNulls
Methods inherited from interface org.soliscode.test.contract.object.EqualsContract
testEqualsForNullValue, testEqualsIsConsistent, testEqualsIsReflexive, testEqualsIsSymmetric, testEqualsIsTransitive
Methods inherited from interface org.soliscode.test.contract.iterable.ForEachContract
testForEachForEmptyCollection, testForEachWithNullAction, testForeEachOverCollectionWithElements
Methods inherited from interface org.soliscode.test.contract.object.HashCodeContract
testHashCodeDistribution, testHashCodeIsStable, testHashCodeWithEqualValues, testHashDifferentValues
Methods inherited from interface org.soliscode.test.contract.iterable.IteratorContract
testForEachRemainingForNullAction, testForEachRemainingOverEntireCollection, testForEachRemainingOverPartialCollection, testIteratorOverCollectionWithElements, testIteratorOverEmptyCollection, testIteratorRemove, testIteratorRemoveThrowsOnIllegalState
Methods inherited from interface org.soliscode.test.contract.iterable.SpliteratorContract
testHasCharacteristic, testSpliteratorEstimateSizeOnACollectionWithElements, testSpliteratorEstimateSizeOnAnEmptyCollection, testSpliteratorForEachRemainingOnACollectionWithElements, testSpliteratorForEachRemainingOnAnEmptyCollection, testSpliteratorGetExactSizeIfKnownOnACollectionWithElements, testSpliteratorGetExactSizeIfKnownOnAnEmptyCollection, testSpliteratorTryAdvanceOnACollectionWithElements, testSpliteratorTryAdvanceOnAnEmptyCollection, testSpliteratorTrySplitOnACollectionWithElements, testSpliteratorTrySplitOnAnEmptyCollection
Methods inherited from interface org.soliscode.test.SupportedMethods
supportsMethod
Methods inherited from interface org.soliscode.test.contract.object.ToStringContract
testToStringForDifferentValues, testToStringForEqualValues, testToStringIsConsistent, testToStringOverridden
Methods inherited from interface org.soliscode.test.contract.support.WithIntegerElement
elementProvider
-
Constructor Details
-
BreakableIterableTest
public BreakableIterableTest()
-
-
Method Details
-
provider
- Specified by:
provider
in interfaceCollectionProviderSupport<Integer,
BreakableIterable<Integer>> - Specified by:
provider
in interfaceProviderSupport<BreakableIterable<Integer>>
-
testForEachWithDoesNotCallActionBreak
@Test @DisplayName("Test the `forEach` method with the FOR_EACH_DOES_NOT_CALL_ACTION break") public void testForEachWithDoesNotCallActionBreak()Test that theFOR_EACH_DOES_NOT_CALL_ACTION
break causes the iterable to never call the action.- See Also:
-
testForEachWithSkipsFirstElementBreak
@Test @DisplayName("Test the `forEach` method with the FOR_EACH_SKIPS_FIRST_ELEMENT break") public void testForEachWithSkipsFirstElementBreak()Test that theFOR_EACH_SKIPS_FIRST_ELEMENT
break causes theforEach
method to skip the first element.- See Also:
-
testForEachWithSkipsLastElementBreak
@Test @DisplayName("Test the `forEach` method with the FOR_EACH_SKIPS_LAST_ELEMENT break") public void testForEachWithSkipsLastElementBreak()Test that theFOR_EACH_SKIPS_LAST_ELEMENT
break causes theforEach
method to skip the last element.- See Also:
-
testForEachWithThrowsWrongExceptionBreak
@Test @DisplayName("Test the `forEach` method with the FOR_EACH_THROWS_WRONG_EXCEPTION_FOR_NULL_ARGUMENT break") public void testForEachWithThrowsWrongExceptionBreak()Test that theFOR_EACH_THROWS_WRONG_EXCEPTION_FOR_NULL_ARGUMENT
break causes theforEach
method to throw the wrong exception when the argument isnull
.- See Also:
-
testBuilderAddElements
@Test public void testBuilderAddElements() -
testBuilderSetCharacteristics
@ParameterizedTest @ValueSource(ints={16,1,4,64,16384,256,1024,4096}) public void testBuilderSetCharacteristics(int characteristics) -
testBuilderCopy
@Test public void testBuilderCopy() -
testIteratorRemoveWithoutSupport
@Test public void testIteratorRemoveWithoutSupport() -
testIteratorForEachRemainingWithoutSupport
@Test public void testIteratorForEachRemainingWithoutSupport()
-