MapAssertions<TKey, TValue> class

Contains a number of methods to assert that a Map is in the expected state.

Inheritance

Constructors

MapAssertions(Map<TKey, TValue>? subject, {bool isReversed = false, String? subjectLabel})
Initializes a new instance of the MapAssertions class.

Properties

and MapAssertions<TKey, TValue>
Bind assertions
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isReversed bool
Checking reverse
finalinherited
not MapAssertions<TKey, TValue>
Invert assertion
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subject Map<TKey, TValue>?
the object which value is being asserted.
finalinherited
subjectLabel String
Friendly label for the subject object
no setterinherited

Methods

as(String subjectLabel) MapAssertions<TKey, TValue>
Set friendly title for the subject
inherited
be(Object expected) MapAssertions<TKey, TValue>
Asserts that the current dictionary contains all the same key-value pairs as the specified expected dictionary. Keys and values are compared using their Object implementation.
override
beAssignableTo<U>() → U?
Asserts that the object is assignable to a variable of type U
inherited
beEmpty() MapAssertions
Asserts that the dictionary does not contain any items.
beNull() MapAssertions<TKey, TValue>
Asserts that the object is not null
inherited
beOfType<U>() → U?
Asserts that the object is not of the specified type U
inherited
beOneOf(Iterable<Map<TKey, TValue>> validItems) MapAssertions<TKey, TValue>
Asserts that a value is one of the specified validItems
inherited
contain(Iterable<MapEntry<TKey, TValue>> expected) MapAssertions
Asserts that the dictionary contains the specified values in specified keys.
containKey(TKey key) MapAssertions
Asserts that the dictionary contains the specified key. Keys are compared using their object implementation.
containKeys(Iterable<TKey> expected) MapAssertions
Asserts that the dictionary contains all of the specified keys. Keys are compared using their Object implementation.
containKeyWithValue(TKey key, TValue value) MapAssertions
Asserts that the dictionary contains the specified value in specified key.
copy(Map<TKey, TValue>? subject, {bool isReversed = false, String? subjectLabel}) MapAssertions<TKey, TValue>
Copy the matcher
override
haveCount(int expected) MapAssertions
Asserts that the number of items in the dictionary matches the supplied expected amount. expected The expected number of items.
haveValueInKey(TKey key) MapAssertions
Asserts that the dictionary contains a value (not null) in specified key.
isEqual(Map<TKey, TValue> expected) bool
Comparison with an another expected value
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited