new MapSubject(failureStrategy, value)
Subclass of Subject which provides assertions methods for Map types.
Parameters:
Name | Type | Description |
---|---|---|
failureStrategy |
FailureStrategy | The failure strategy to use when an assertion fails. |
value |
object | The value being checked. |
- Source:
Extends
- Subject
Methods
containsEntry(key, value) → {MapSubject}
Ensure that the map contains a given key / value pair.
Parameters:
Name | Type | Description |
---|---|---|
key |
* | The key expected to be in the map. |
value |
* | The expected value for that key. |
- Source:
Returns:
this
for chaining.
- Type
- MapSubject
containsKey(key) → {MapSubject}
Ensure that the map contains a given key.
Parameters:
Name | Type | Description |
---|---|---|
key |
* | The key expected to be in the map. |
- Source:
Returns:
this
for chaining.
- Type
- MapSubject
doesNotContainKey(key) → {MapSubject}
Ensure that the map does not contain a given key.
Parameters:
Name | Type | Description |
---|---|---|
key |
* | The key not expected to be in the map. |
- Source:
Returns:
this
for chaining.
- Type
- MapSubject
hasSize(size) → {MapSubject}
Ensure that the map is the expected size.
Parameters:
Name | Type | Description |
---|---|---|
size |
number | The expected size of the map. |
- Source:
Returns:
this
for chaining.
- Type
- MapSubject
isEmpty() → {MapSubject}
Ensure that the map is empty.
- Source:
Returns:
this
for chaining.
- Type
- MapSubject
isNotEmpty() → {MapSubject}
Ensure that the map is non-empty.
- Source:
Returns:
this
for chaining.
- Type
- MapSubject