# Testing Strategy

1. **Signaling tests** verify that every `SignalingMessage` variant round-trips through `encode_signaling`/`decode_signaling` and that malformed payloads trigger the correct errors.
2. **State machine tests** exercise outbound and inbound call flows, using `MockWebRtcEngine` to deterministically control SDP strings and inject ICE candidates without touching the real network stack.
3. **Negative tests** assert that invalid state transitions, empty SDPs, and malformed candidates raise the documented errors.

The mock engine captures applied answers, tracks toggles, and exposes helper methods to emit synthetic ICE events. This keeps unit tests fast, hermetic, and independent from the heavy `webrtc-rs` runtime while still exercising the full public API surface.
