DummyLiveConnection
A fake LiveConnection that runs steps in order and records every message sent to it.
Only one receive() may run at a time, a turn-complete response ends the current receive(), and the next receive() resumes at the following step. If the steps run out without DummyLiveStep.EndStream, receive() waits up to 5 seconds for closeSession and then fails the test.
Constructors
Creates a connection that waits up to 5 seconds for each DummyLiveStep.AwaitSent and for closeSession once the steps run out.
Properties
Whether closeSession has been called.
All messages sent to this connection in order: a List<Content> from sendHistory, a ContentInput from sendContent, or a RealtimeInput from sendRealtime. Sends made after closeSession are still recorded.
Functions
Throws AssertionError naming the first DummyLiveStep.AwaitSent that receive() never got past, even if a matching message was sent later. Call it at the end of a test: closing the connection ends a waiting receive() without failing, so an early close would otherwise pass.