testController<T> function
void
testController<
T>( - String description,
- void callback(
- T
), {
- required T controller,
- void onInit(
- T
)?,
- void onReady(
- T
)?,
- void onClose(
- T
)?,
})
Implementation
@isTest
void testController<T>(
String description,
void Function(T) callback, {
required T controller,
void Function(T)? onInit,
void Function(T)? onReady,
void Function(T)? onClose,
}) {
test(description, () {
onInit?.call(controller);
SchedulerBinding.instance?.addPostFrameCallback((f) {
onReady?.call(controller);
});
callback(controller);
onClose?.call(controller);
});
}