I want to create an integration test that sends data to server and gets the response from ClientWebSocket
.
[Fact]
public async Task WebSocket_Sending()
{
var client = new ClientWebSocket();
await client.ConnectAsync(Uri, CancellationToken.None);
var sending = client.SendAsync(data, WebSocketMessageType.Binary, CancellationToken.None);
var response = ????
Assert.AreEqual(response, "response");
}
But the web socket communication is not a send/receive mechanism. So I could not find a way to test the results. How can I do this?