public class MapAssert extends GroupAssert<MapAssert,Map<?,?>>
Map
s.
To create a new instance of this class invoke
.
Assertions.assertThat(Map)
Modifier and Type | Class and Description |
---|---|
static class |
MapAssert.Entry
An entry in a
. |
actual, myself
Modifier | Constructor and Description |
---|---|
protected |
MapAssert(Map<?,?> actual)
Creates a new
MapAssert . |
Modifier and Type | Method and Description |
---|---|
protected int |
actualGroupSize()
Returns the number of elements in the actual
. |
static MapAssert.Entry |
entry(Object key,
Object value)
Creates a new map entry.
|
MapAssert |
excludes(MapAssert.Entry... entries)
Verifies that the actual
does not contain the given entries. |
MapAssert |
includes(MapAssert.Entry... entries)
Verifies that the actual
contains the given entries. |
hasSize, isEmpty, isNotEmpty, isNullOrEmpty
as, as, describedAs, describedAs, doesNotSatisfy, is, isEqualTo, isIn, isIn, isNot, isNotEqualTo, isNotIn, isNotIn, isNotNull, isNotSameAs, isNull, isSameAs, overridingErrorMessage, satisfies
customErrorMessage, description, description, description, equals, fail, fail, failIfCustomMessageIsSet, failIfCustomMessageIsSet, failure, formattedErrorMessage, hashCode, rawDescription, replaceDefaultErrorMessagesWith
public MapAssert includes(MapAssert.Entry... entries)
Map
contains the given entries.
Example:
// static import org.fest.assertions.Assertions.*; // static import org.fest.assertions.MapAssert.*; assertThat(myMap).includes
(entry
("jedi", yoda),entry
("sith", anakin));
entries
- the given entries.AssertionError
- if the actual map is null
.AssertionError
- if the actual Map
does not contain any of the given entries.NullPointerException
- if the given array of entries is null
.NullPointerException
- if any of the entries in the given array is null
.public MapAssert excludes(MapAssert.Entry... entries)
Map
does not contain the given entries.
Example:
// static import org.fest.assertions.Assertions.*; // static import org.fest.assertions.MapAssert.*; assertThat(myMap).excludes
(entry
("jedi", yoda),entry
("sith", anakin));
entries
- the given entries.AssertionError
- if the actual map is null
.AssertionError
- if the actual Map
contains any of the given entries.NullPointerException
- if the given array of entries is null
.NullPointerException
- if any of the entries in the given array is null
.public static MapAssert.Entry entry(Object key, Object value)
key
- the key of the entry.value
- the value of the entry.includes(org.fest.assertions.MapAssert.Entry...)
protected int actualGroupSize()
Map
.actualGroupSize
in class GroupAssert<MapAssert,Map<?,?>>
Map
.Copyright © 2007-2013 FEST (Fixtures for Easy Software Testing). All Rights Reserved.