client_test library

Classes

ApiRequest<TRequest extends RequestBase, TResponse extends ResponseBase>
ApiRequestConfig<TResponse extends ResponseBase>
AppContract
The base contract definition.
AppStackTrace
BaseAppApi<TConfig extends BaseClientConfig>
The base API implementation for making live and mocked web requests.
BaseClientConfig
The configuration for the client API.
BaseClientRegistry<TConfig extends BaseClientConfig>
The server-side injection registry.
BaseConfig
The base configuration model
CognitoConfig
The required Cognito configuration
ErrorResponse
MockHttpClient
MockRequest
MockResponse
Registry<TConfig extends BaseConfig>
An injection registry.
RequestBase
ResponseBase
TestClientConfig

Functions

getTestConfig([Map<String, String>? overrides]) TestClientConfig
getTestEnv([Map<String, String>? overrides]) Map<String, String>
makeFakes<T>({required ThingGenerator<T> factory, int count = 20}) List<T>
Generates a non-growable count sized list of the items returned by factory.
randomBool() bool
Generates a random bool value.
randomId([int length = 12]) String
Generates a random alpha-numeric ascii encoded value of the specified length (defaults to 12).
randomInt(int min, int max) int
Generates a random integer between min and max.
uriContains(String part) → Matcher
uriEndsWith(String suffix) → Matcher
uriStartsWith(String prefix) → Matcher

Typedefs

ApiTimeoutHandler<TResponse> = (FutureOr<TResponse?> Function()?)
The timeout handler definition used by the BaseAppApi.
ConfigBuilder<T, TConfig extends BaseConfig> = T Function(TConfig config)
The function signature of a configuration-driven factory builder
JsonDeserializer<TResponse> = TResponse Function(Map<String, dynamic> json)
MissingValueHandler<T> = T? Function(String key)
RandomBool = bool Function()
The shape of a bool producing function.
RandomNumber = int Function(int min, int max)
The shape of a number producing function.
ThingGenerator<T> = T Function(int index, RandomNumber random, RandomBool yesOrNo)
The shape of a T producing function.
UriResolver = Uri Function(String relative)