org.truth0.subjects
Class IterableSubject<S extends IterableSubject<S,T,C>,T,C extends Iterable<T>>

java.lang.Object
  extended by org.truth0.subjects.Subject<S,C>
      extended by org.truth0.subjects.IterableSubject<S,T,C>
Direct Known Subclasses:
CollectionSubject

@GwtCompatible
public class IterableSubject<S extends IterableSubject<S,T,C>,T,C extends Iterable<T>>
extends Subject<S,C>

Author:
Kevin Bourrillion

Field Summary
 
Fields inherited from class org.truth0.subjects.Subject
failureStrategy
 
Constructor Summary
protected IterableSubject(FailureStrategy failureStrategy, C list)
           
 
Method Summary
static
<T,C extends Iterable<T>>
IterableSubject<? extends IterableSubject<?,T,C>,T,C>
create(FailureStrategy failureStrategy, Iterable<T> list)
           
 void isEmpty()
          Attests that the subject holds no more objects, or fails.
 void isNotEmpty()
          Attests that the subject holds one or more objects, or fails
 void iteratesOverSequence(Object... expectedItems)
          Asserts that the items are supplied in the order given by the iterable.
 
Methods inherited from class org.truth0.subjects.Subject
check, fail, failWithBadResults, failWithoutSubject, getSubject, is, isEqualTo, isNotEqualTo, isNotNull, isNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IterableSubject

protected IterableSubject(FailureStrategy failureStrategy,
                          C list)
Method Detail

create

public static <T,C extends Iterable<T>> IterableSubject<? extends IterableSubject<?,T,C>,T,C> create(FailureStrategy failureStrategy,
                                                                                                     Iterable<T> list)

isEmpty

public void isEmpty()
Attests that the subject holds no more objects, or fails.


isNotEmpty

public void isNotEmpty()
Attests that the subject holds one or more objects, or fails


iteratesOverSequence

public void iteratesOverSequence(Object... expectedItems)
Asserts that the items are supplied in the order given by the iterable. For Collections and other things which contain items but may not have guaranteed iteration order, this method should be overridden.



Copyright © 2012. All Rights Reserved.