darwin_test library
A simple test library for the darwin framework.
Classes
- DummyHttpConnectionInfo
- IsBound
-
Matcher that checks if an
InjectorKey
is bound. - IsNotRunning
- Matcher that checks if a service is not running.
- IsRunning
- Matcher that checks if a service is running.
- IsUnbound
-
Matcher that checks if an
InjectorKey
is not bound. - ReadResponse
- ResponseBodyMatcher
- ResponseBodyStringMatcher
- ResponseHeaderStringMatcher
- ResponseStatusMatcher
Properties
- emptyGeneratedArgs ↔ DarwinSystemGeneratedArgs
-
getter/setter pair
- emptyUserArgs ↔ DarwinSystemUserArgs
-
getter/setter pair
Functions
-
createInfantSystem(
{Module? appModule, List< DarwinPlugin> plugins = const [], List<ServiceDescriptor> ? services}) → DarwinSystem -
Creates an initialized but not fully started
DarwinSystem
that can be used for testing which involves manual startup logic. TheappModule
as well asplugins
which will be used for by theDarwinSystemUserArgs
can be optionally specified. The initialDarwinSystemGeneratedArgs
which are passed toDarwinSystem.prepare
will contain no service bindings. -
expectResponse(
DarwinSystem system, Matcher matcher, {required String path, Method method = Method.get, String? body, Map< String, dynamic> query = const {}, Map<String, String> headers = const {}}) → void -
hasBody(
String body) → Matcher -
hasHeader(
String key, String? value) → Matcher -
hasStatus(
int code) → Matcher -
isBody(
String body) → Matcher -
isBound(
InjectorKey key) → Matcher -
Asserts that a
key
is bound in the givenDarwinSystem
orInjector
. -
isNotRunning<
T> () → Matcher -
Asserts that a service that is injectable by
T
is not running in aDarwinSystem
. -
isRunning<
T> () → Matcher -
Asserts that a service that is injectable by
T
is running in aDarwinSystem
. -
isStatus(
int code) → Matcher -
isUnbound(
InjectorKey key) → Matcher -
Asserts that a
key
is not bound in the givenDarwinSystem
orInjector
. -
startApplication(
FutureOr< DarwinApplication> activator(), [FutureOr<void> callback(DarwinApplication)?]) → Future<DarwinSystem> -
startSystem(
List< ServiceDescriptor> services, {Module? appModule, List<DarwinPlugin> plugins = const []}) → Future<DarwinSystem> -
Creates and start a general-use default
DarwinSystem
implementation. Must contain a list ofservices
which will be used to create theDarwinSystemGeneratedArgs
. TheappModule
as well asplugins
used to construct theDarwinSystemUserArgs
can be optionally specified.