testSimpleBloc<Event, T> function

void testSimpleBloc<Event, T>({
  1. required String description,
  2. required SimpleBloc<Event, T> build(),
  3. required Event event,
  4. required T expectedData,
  5. String? expectedMessage,
  6. List<SimpleState<T>> expect()?,
})

Implementation

void testSimpleBloc<Event, T>({
  required String description,
  required SimpleBloc<Event, T> Function() build,
  required Event event,
  required T expectedData,
  String? expectedMessage,
  List<SimpleState<T>> Function()? expect,
}) {
  blocTest<SimpleBloc<Event, T>, SimpleState<T>>(
    description,
    build: build,
    act: (bloc) => bloc.add(event),
    expect: expect ??
        () => [SimpleState<T>.loading(), SimpleState<T>.success(expectedData)],
  );
}