Exemple #1
0
        public async Task WebSocketTransport_SetsState()
        {
            var sock = new FauxSock();

            sock.RealState = WebSocketState.Open;
            var transport = new WebSocketTransport(sock);

            transport.Close();
            transport.Dispose();

            Assert.Equal(WebSocketState.Closed, sock.RealState);
        }
Exemple #2
0
        public async Task WebSocketTransport_Connects()
        {
            var sock = new FauxSock();

            sock.RealState = WebSocketState.Open;
            var transport = new WebSocketTransport(sock);

            Assert.True(transport.IsConnected);

            transport.Close();
            transport.Dispose();
        }