darwin_test library
A simple test library for the darwin framework.
Classes
- DummyHttpConnectionInfo
- IsBound
-
Matcher that checks if an
InjectorKeyis 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
InjectorKeyis 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
DarwinSystemthat can be used for testing which involves manual startup logic. TheappModuleas well aspluginswhich will be used for by theDarwinSystemUserArgscan be optionally specified. The initialDarwinSystemGeneratedArgswhich are passed toDarwinSystem.preparewill 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
keyis bound in the givenDarwinSystemorInjector. -
isNotRunning<
T> () → Matcher -
Asserts that a service that is injectable by
Tis not running in aDarwinSystem. -
isRunning<
T> () → Matcher -
Asserts that a service that is injectable by
Tis running in aDarwinSystem. -
isStatus(
int code) → Matcher -
isUnbound(
InjectorKey key) → Matcher -
Asserts that a
keyis not bound in the givenDarwinSystemorInjector. -
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
DarwinSystemimplementation. Must contain a list ofserviceswhich will be used to create theDarwinSystemGeneratedArgs. TheappModuleas well aspluginsused to construct theDarwinSystemUserArgscan be optionally specified.