Interface RemoveFirstContract<E,C extends SequencedCollection<E>>

Type Parameters:
E - The element type.
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:
ListContract<E,L>, SequencedCollectionContract<E,C>

public interface RemoveFirstContract<E,C extends SequencedCollection<E>> extends CollectionContractSupport<E,C>

Test for the removeFirst method in the SequencedCollection interface. This contract class can be used individually by a test class, but it is normally used through the SequencedCollectionContract class:

public class MyCollectionTest extends SequencedCollectionContract<Integer, MyCollection<Integer>> {
}

If a test is using the SequencedCollectionContract class, but the class being tested does not implement the removeFirst method based upon the specification in the SequencedCollection class, then it can be omitted from the tests using the doesNotSupportMethod() method:

public class MyCollectionTest extends SequencedCollectionContract<Integer, MyCollection<Integer>> {
    public MyCollectionTest() {
        doesNotSupportMethod(CollectionMethods.RemoveFirst);
    }
}
Since:
1.0
Author:
evanbergstrom
  • Method Details

    • testRemoveFirst

      @DisplayName("Test that the removeFirst method works") @Test default void testRemoveFirst()
      Tests that the removeFirst method works.
      Throws:
      org.opentest4j.AssertionFailedError - if the test fails.
      See Also:
    • testRemoveFirstOnEmptyCollection

      @DisplayName("Test that the removeFirst method throws for an empty collection") @Test default void testRemoveFirstOnEmptyCollection()
      Tests that the removeFirst method works for an empty collection.
      Throws:
      org.opentest4j.AssertionFailedError - if the test fails.
      See Also: