test<T extends ApiService> method
Implementation
Future<void> Function() test<T extends ApiService>(
[FutureOr<void> Function()? body]) {
return () async {
try {
await initialize();
} catch (_) {
fail('TestHost does not initialize.');
}
try {
if (body != null) {
await runAsService(body);
}
} finally {
try {
await shutdown();
} catch (_) {
fail('TestHost does shutdown gracefully.');
}
}
};
}