public async Task ConnectAsync_TestTransportClientThatEmulatesRtspServer_ConnectionEstablished() { var transportClient = new RtspTransportClientEmulator(); var rtspClient = new RtspClientInternal(_fakeConnectionParameters, () => transportClient); await rtspClient.ConnectAsync(CancellationToken.None); }
public async Task ReceiveAsync_InterleavedModeAndOneRtcpByePacketInStream_SuccessfullyFinished() { var transportClient = new RtspTransportClientEmulator(); var rtspClient = new RtspClientInternal(_fakeConnectionParameters, () => transportClient); await rtspClient.ConnectAsync(CancellationToken.None); await rtspClient.ReceiveAsync(CancellationToken.None); }
public async Task ConnectAsync_CancellationRequested_ThrowsException() { var transportClient = new RtspTransportClientEmulator(); var cancellationTokenSource = new CancellationTokenSource(); cancellationTokenSource.Cancel(); var rtspClient = new RtspClientInternal(_fakeConnectionParameters, () => transportClient); await rtspClient.ConnectAsync(cancellationTokenSource.Token); }
public async Task ReceiveAsync_CancellationRequested_ImmediateReturn() { var transportClient = new RtspTransportClientEmulator(); var rtspClient = new RtspClientInternal(_fakeConnectionParameters, () => transportClient); var cancellationTokenSource = new CancellationTokenSource(); cancellationTokenSource.Cancel(); await rtspClient.ConnectAsync(CancellationToken.None); await rtspClient.ReceiveAsync(cancellationTokenSource.Token); }