public class IteratorAssert extends ObjectGroupAssert<IteratorAssert,Iterator<?>>
Iterators.
To create a new instance of this class invoke .
Assertions.assertThat(Iterator)
actual, myself| Modifier | Constructor and Description |
|---|---|
protected |
IteratorAssert(Iterator<?> actual)
Creates a new
IteratorAssert. |
| Modifier and Type | Method and Description |
|---|---|
protected List<Object> |
actualAsList()
Returns the actual value as a
List. |
protected Set<Object> |
actualAsSet()
Returns the actual value as a
Set. |
protected int |
actualGroupSize()
Returns the size of the actual group of values (array, collection, etc.)
|
protected IteratorAssert |
onProperty(String propertyName)
Creates a new group of objects whose target collection contains the values of the given property name from the
elements of the actual group of objects.
|
contains, containsOnly, doesNotHaveDuplicates, excludesassertContains, assertContainsOnly, assertDoesNotHaveDuplicates, assertExcludes, validateIsNotNullhasSize, isEmpty, isNotEmpty, isNullOrEmptyas, as, describedAs, describedAs, doesNotSatisfy, is, isEqualTo, isIn, isIn, isNot, isNotEqualTo, isNotIn, isNotIn, isNotNull, isNotSameAs, isNull, isSameAs, overridingErrorMessage, satisfiescustomErrorMessage, description, description, description, equals, fail, fail, failIfCustomMessageIsSet, failIfCustomMessageIsSet, failure, formattedErrorMessage, hashCode, rawDescription, replaceDefaultErrorMessagesWithprotected IteratorAssert(Iterator<?> actual)
IteratorAssert.actual - the target to verify.protected IteratorAssert onProperty(String propertyName)
Person.age
and nested properties Person.father.age.
For example, let's say we have a collection of Person objects and you want to verify their age:
assertThat(persons).onProperty("age").containsOnly(25, 16, 44, 37); // simple property
assertThat(persons).onProperty("father.age").containsOnly(55, 46, 74, 62); // nested property
onProperty in class ObjectGroupAssert<IteratorAssert,Iterator<?>>propertyName - the name of the property to extract values from the actual collection to build a new group of
objects.protected Set<Object> actualAsSet()
Set.actualAsSet in class ItemGroupAssert<IteratorAssert,Iterator<?>>Set.protected List<Object> actualAsList()
List.actualAsList in class ItemGroupAssert<IteratorAssert,Iterator<?>>List.protected int actualGroupSize()
actualGroupSize in class GroupAssert<IteratorAssert,Iterator<?>>Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.