Interface SetTests.AddAllTests<T>
-
- Type Parameters:
T
- The element type of the set to test.
- All Superinterfaces:
CollectionTests<T>
,IterableTests<T>
,SetTests<T>
@TestInstance(PER_CLASS) @DisplayName("addAll(Collection)") public static interface SetTests.AddAllTests<T> extends SetTests<T>
Contains tests forSet.addAll(Collection)
.By default, the tests in this interface assume that calling
Set.addAll(Collection)
with a collection containingnull
will simply add thenull
. If this is not the case, annotate your class withStoreNullNotSupported
.- Author:
- Rob Spoor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.robtimus.junit.support.test.collections.CollectionTests
CollectionTests.ClearTests<T>, CollectionTests.ContainsAllTests<T>, CollectionTests.ContainsTests<T>, CollectionTests.RemoveAllArgumentsProvider, CollectionTests.RemoveAllTests<T>, CollectionTests.RemoveArgumentsProvider, CollectionTests.RemoveIfTests<T>, CollectionTests.RemoveTests<T>, CollectionTests.RetainAllArgumentsProvider, CollectionTests.RetainAllTests<T>, CollectionTests.ToArrayTests<T>, CollectionTests.ToArrayWithGeneratorTests<T>, CollectionTests.ToObjectArrayTests<T>
-
Nested classes/interfaces inherited from interface com.github.robtimus.junit.support.test.collections.IterableTests
IterableTests.ForEachTests<T>
-
Nested classes/interfaces inherited from interface com.github.robtimus.junit.support.test.collections.SetTests
SetTests.AddAllArgumentsProvider, SetTests.AddAllTests<T>, SetTests.AddArgumentsProvider, SetTests.AddTests<T>, SetTests.EqualsArgumentsProvider, SetTests.EqualsTests<T>, SetTests.HashCodeTests<T>, SetTests.SpliteratorTests<T>
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
addElementsToExpected(List<T> expected, Collection<? extends T> elements)
Adds multiple elements to a list of expected elements.default void
testAddAll(Collection<? extends T> c, boolean expected)
default void
testAddAllWithCollectionWithNull(TestInfo testInfo)
default void
testAddAllWithNullCollection()
-
Methods inherited from interface com.github.robtimus.junit.support.test.collections.CollectionTests
nonContainedElements
-
Methods inherited from interface com.github.robtimus.junit.support.test.collections.IterableTests
expectedElements, fixedOrder
-
-
-
-
Method Detail
-
addElementsToExpected
default void addElementsToExpected(List<T> expected, Collection<? extends T> elements)
Adds multiple elements to a list of expected elements. IfIterableTests.fixedOrder()
returnstrue
, it may be necessary to override this method to ensure the expected elements remain in the correct fixed order.Note that you don't need to worry about duplicates, that will be taken care of.
- Parameters:
expected
- The existing expected elements.elements
- The elements to add.
-
testAddAll
@ParameterizedTest(name="{0}: {1}") @ArgumentsSource(AddAllArgumentsProvider.class) @DisplayName("addAll(Collection)") default void testAddAll(Collection<? extends T> c, boolean expected)
-
testAddAllWithNullCollection
@Test @DisplayName("addAll(Collection) with a null collection") default void testAddAllWithNullCollection()
-
testAddAllWithCollectionWithNull
@Test @DisplayName("addAll(Collection) with a collection with a null") default void testAddAllWithCollectionWithNull(TestInfo testInfo)
-
-