defineQueryResponseDynamic<TQuery extends AFAsyncQuery> method
void
defineQueryResponseDynamic<TQuery extends AFAsyncQuery>({
- Object? querySpecifier,
- required AFCreateQueryResultDelegate<
TQuery> body,
Create a response dynamically for a particular query.
This method is useful when you have query methods which 'write' data, where often the data doesn't change at all when it is writen, or the changes are simple (like a new identifier is returned, or the update-timestamp for the data is created by the server). Using this method, in many cases you can cause 'workflow' prototypes to behave very much like they have a back end server, despite the fact that they do not.
When the query 'executes', its AFAsyncQuery.startAsync method will be skipped and its AFAsyncQuery.finishAsyncWithResponse method will be called with the test data that is AFCreateDynamicQueryResultContext.onSuccess or AFCreateDynamicQueryResultContext.onError.
Implementation
void defineQueryResponseDynamic<TQuery extends AFAsyncQuery>({ Object? querySpecifier, required AFCreateQueryResultDelegate<TQuery> body}) {
assert(TQuery != AFAsyncQuery);
test.defineQueryResponseDynamic<TQuery>(querySpecifier ?? TQuery, body);
}