expectStateTypes method

void expectStateTypes(
  1. Iterable<Type> expected
)

Verify the exact sequence of recorded runtime types.

This helper is framework-independent and throws a descriptive exception on mismatch. Use ordinary matcher assertions when richer value checks are required.

Implementation

void expectStateTypes(Iterable<Type> expected) {
  final expectedValues = List<Type>.of(expected);
  final actualValues = <Type>[for (final state in _states) state.runtimeType];

  if (_sameTypes(actualValues, expectedValues)) return;
  throw EffectCommandProbeExpectationException(
    expected: expectedValues,
    actual: actualValues,
  );
}