Interface RemoveContract<E,C extends Collection<E>>
- Type Parameters:
E
- The element type being tested.C
- The collection type being tested.
- All Superinterfaces:
CollectionContractConfig
,CollectionContractSupport<E,
,C> CollectionProviderSupport<E,
,C> ContractSupport<C>
,ElementProviderSupport<E>
,ProviderSupport<C>
,SupportedMethods
- All Known Subinterfaces:
CollectionContract<E,
,C> ListContract<E,
,L> SequencedCollectionContract<E,
C>
This interface tests if a collection class has implemented the
remove
method correctly.- Since:
- 1.0.0
- Author:
- evanbergstrom
- See Also:
-
Field Summary
Fields inherited from interface org.soliscode.test.contract.support.CollectionContractSupport
DEFAULT_SIZE
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Tests that theremove
method works on a container with elements.default void
Tests that theremove
method works withnull
elements.default void
Tests that theremove
method works on an empty container.default void
Tests that theremove
method works with incompatible objects.Methods inherited from interface org.soliscode.test.contract.CollectionContractConfig
permitDuplicates, permitIncompatibleTypes, permitNulls
Methods inherited from interface org.soliscode.test.contract.support.CollectionProviderSupport
provider
Methods inherited from interface org.soliscode.test.contract.support.ElementProviderSupport
elementProvider
Methods inherited from interface org.soliscode.test.SupportedMethods
supportsMethod
-
Method Details
-
testRemoveOnEmptyContainer
@Test @DisplayName("The remove method can be called on an empty container") default void testRemoveOnEmptyContainer()Tests that theremove
method works on an empty container. -
testRemoveOnContainerWithElements
@Test @DisplayName("The remove method works on a container with elements") default void testRemoveOnContainerWithElements()Tests that theremove
method works on a container with elements. #Implementation Note There is no guarantee of the order that the elements are added to the collection, but in case they are stored in the same order they are added, this test will remove elements that are added first, added lsat, and added in the middle. -
testRemoveOnContainerWithNulls
@Test @DisplayName("The remove method works with null elements") default void testRemoveOnContainerWithNulls()Tests that theremove
method works withnull
elements. -
testRemoveOnIncompatibleObject
@Test @DisplayName("The remove method works with incompatible types") default void testRemoveOnIncompatibleObject()Tests that theremove
method works with incompatible objects.
-