checkEventWasReceived method

  1. @visibleForTesting
bool checkEventWasReceived(
  1. Type event, {
  2. int? count,
})

Returns true if underlying events list contains given event name

event - event type to check count - optional count of events that must have been received

Implementation

@visibleForTesting
bool checkEventWasReceived(Type event, {int? count}) {
  if (count == null) {
    return _receivedEvents.contains(event);
  }

  return _receivedEvents.whereType<Type>().length == count;
}