public void ReadWriteAfterAbortTest()
        {
            var websocket = new ClientWebSocket();
            // Set SubProtocol to AMQPWSB10
            websocket.Options.AddSubProtocol(WebSocketConstants.SubProtocols.Amqpwsb10);
            Uri uri = new Uri("ws://" + IotHubName + ":" + Port + WebSocketConstants.UriSuffix);
            websocket.ConnectAsync(uri, CancellationToken.None).Wait(CancellationToken.None);
            clientWebSocketTransport = new ClientWebSocketTransport(websocket, IotHubName, null, null);
            clientWebSocketTransport.Abort();

            try
            {
                TransportAsyncCallbackArgs args = new TransportAsyncCallbackArgs();
                args.SetBuffer(byteArray, 0, byteArray.Length);
                clientWebSocketTransport.WriteAsync(args);
                Assert.Fail("Did not throw object disposed exception");
            }
            catch(ObjectDisposedException)
            {

            }

            try
            {
                TransportAsyncCallbackArgs args = new TransportAsyncCallbackArgs();
                byte[] byteArray = new byte[10];
                args.SetBuffer(byteArray, 0, 10);
                clientWebSocketTransport.ReadAsync(args);
                Assert.Fail("Did not throw object disposed exception");
            }
            catch (ObjectDisposedException)
            {

            }
        }
 public async Task WriteAfterAbortTest()
 {
     var websocket = new ClientWebSocket();
     // Set SubProtocol to AMQPWSB10
     websocket.Options.AddSubProtocol(WebSocketConstants.SubProtocols.Amqpwsb10);
     Uri uri = new Uri("ws://" + IotHubName + ":" + Port + WebSocketConstants.UriSuffix);
     await websocket.ConnectAsync(uri, CancellationToken.None);
     clientWebSocketTransport = new ClientWebSocketTransport(websocket, null, null);
     clientWebSocketTransport.Abort();
     var args = new TransportAsyncCallbackArgs();
     args.SetBuffer(byteArray, 0, byteArray.Length);
     clientWebSocketTransport.WriteAsync(args);
 }