recordPulses method
Records pulses from the cell registered at id.
The recorder is tracked by the harness and auto-stopped on dispose.
If you call recorder.stop() early, the harness's dispose remains
safe (stop is idempotent).
Parameters:
id: The Registration Key.
Returns:
A live PulseRecorder over the registered cell. The recorder is already subscribed and recording.
Throws:
- StateError when dispose has already been called.
- StateError when
idis not registered.
See Also:
- CellRecordPulses.recordPulses — the underlying helper.
- PulseRecorder — the recorder type.
- dispose — releases every recorder this method created.
Implementation
PulseRecorder<Cell> recordPulses(Symbol id) {
if (_disposed) {
throw StateError('CellTestHarness: recordPulses called after dispose.');
}
final c = _cells[id];
if (c == null) {
throw StateError('CellTestHarness: no cell registered at $id.');
}
final recorder = c.recordPulses();
_recorders.add(recorder);
return recorder;
}