AFDefineTestDataContext class

A registry of test data objects which can be referenced by an id.

It is usually best to use strings for ids, even if your underlying data store uses integer ids (just convert the integers). Using strings allows you to use descriptive ids for test data, which will then often show up as part of widget ids in your UI, making debugging easier.

Constructors

AFDefineTestDataContext({required Map testData})
AFDefineTestDataContext.create()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
no setter
isNotEmpty bool
no setter
log → Logger?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
testData Map
final

Methods

currentTime() AFTimeState
currentTimeUTC() AFTimeState
define<TData>(dynamic id, TData data) → TData
Associates the test data id id with the value data, and returns the data for further use.
defineIdentifierList<TValue>(Object id, List<String> listIds) List<TValue>
Creates a list of objects of a given type from a list of existing test data ids.
defineIdentifierMap<TValue>(Object id, List list, {String getId(TValue)?}) Map<String, TValue>
Creates a map from test data ids to object values
defineRootStateObjectList(Object id, List<Object> sources) List<Object>
Given a list of test data ids and object values in sources, resolves them into a list of root state objects, and returns that list.
find<T>(dynamic id) → T
Find a test data object by its id, but if the id is not a string, just return it.
findAll<T>(List<String> ids) List<T>
findList<TData>(List ids) List<TData>
findModels(dynamic id) → dynamic
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveStateViewModels(dynamic sources) Map<String, Object>
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

createdTestIds List<String>
getter/setter pair
uniqueId String
no setter
uniqueIdBase int
getter/setter pair

Constants

nowId → const String