org.junit.contrib.truth.subjects
Class CollectionSubject<S extends CollectionSubject<S,T,C>,T,C extends Collection<T>>
java.lang.Object
org.junit.contrib.truth.subjects.Subject<S,C>
org.junit.contrib.truth.subjects.IterableSubject<S,T,C>
org.junit.contrib.truth.subjects.CollectionSubject<S,T,C>
- Direct Known Subclasses:
- ListSubject
@GwtCompatible
public class CollectionSubject<S extends CollectionSubject<S,T,C>,T,C extends Collection<T>>
- extends IterableSubject<S,T,C>
Nested classes/interfaces inherited from class org.junit.contrib.truth.subjects.Subject |
Subject.And<C> |
Methods inherited from class org.junit.contrib.truth.subjects.Subject |
check, fail, failWithoutSubject, getSubject, is, isA, isEqualTo, isNotA, isNotEqualTo, isNotNull, isNull, nextChain |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectionSubject
protected CollectionSubject(FailureStrategy failureStrategy,
C list)
create
public static <T,C extends Collection<T>> CollectionSubject<? extends CollectionSubject<?,T,C>,T,C> create(FailureStrategy failureStrategy,
Collection<T> list)
contains
public Subject.And<S> contains(Object item)
- Attests that a Collection contains the provided object or fails.
- Overrides:
contains
in class IterableSubject<S extends CollectionSubject<S,T,C>,T,C extends Collection<T>>
isEmpty
public Subject.And<S> isEmpty()
- Description copied from class:
IterableSubject
- Attests that a Collection contains the provided object or fails.
- Overrides:
isEmpty
in class IterableSubject<S extends CollectionSubject<S,T,C>,T,C extends Collection<T>>
containsAnyOf
public Subject.And<S> containsAnyOf(Object... items)
- Attests that a Collection contains at least one of the provided
objects or fails.
containsAllOf
public Subject.And<S> containsAllOf(Object... items)
- Attests that a Collection contains all of the provided objects or fails.
This copes with duplicates in both the Collection and the parameters.
Copyright © 2014. All Rights Reserved.