Interface SetTests.AddTests<T>
-
- Type Parameters:
T
- The element type of the set to test.
- All Superinterfaces:
CollectionTests<T>
,IterableTests<T>
,SetTests<T>
@TestInstance(PER_CLASS) @DisplayName("add(Object)") public static interface SetTests.AddTests<T> extends SetTests<T>
Contains tests forSet.add(Object)
.By default, the tests in this interface assume that calling
Set.add(Object)
withnull
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
addElementToExpected(List<T> expected, T element)
Adds an element to a list of expected elements.default void
testAdd(T o, boolean expected)
default void
testAddNull(TestInfo testInfo)
-
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
-
addElementToExpected
default void addElementToExpected(List<T> expected, T element)
Adds an element 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.- Parameters:
expected
- The existing expected elements.element
- The element to add.
-
testAdd
@ParameterizedTest(name="{0}: {1}") @ArgumentsSource(AddArgumentsProvider.class) @DisplayName("add(Object)") default void testAdd(T o, boolean expected)
-
testAddNull
@Test @DisplayName("add(Object) with null") default void testAddNull(TestInfo testInfo)
-
-