public async Task Throws() { var uri = new Uri("wss://stream.binance.com:9443"); var client = new DefaultWebSocketClient(); using (var cts = new CancellationTokenSource()) { await Assert.ThrowsAsync <ArgumentNullException>("uri", () => client.StreamAsync(null, cts.Token)); await Assert.ThrowsAsync <ArgumentException>("token", () => client.StreamAsync(uri, CancellationToken.None)); } }
public async Task StreamAsync() { var uri = new Uri("wss://stream.binance.com:9443"); var client = new DefaultWebSocketClient(); using (var cts = new CancellationTokenSource()) { cts.Cancel(); await client.StreamAsync(uri, cts.Token); } }
public async Task Throws() { using (var cts = new CancellationTokenSource()) { await Assert.ThrowsAsync <ArgumentNullException>("uri", () => _webSocket.StreamAsync(null, cts.Token)); await Assert.ThrowsAsync <ArgumentException>("token", () => _webSocket.StreamAsync(_uri, CancellationToken.None)); } }