public async Task Authentication()
        {
            Skip.If(string.IsNullOrWhiteSpace(API_SECRET));

            var url = BitmexValues.ApiWebsocketUrl;

            using (var communicator = new BitmexWebsocketCommunicator(url))
            {
                AuthenticationResponse received = null;
                var receivedEvent = new ManualResetEvent(false);

                using (var client = new BitmexWebsocketClient(communicator))
                {
                    client.Streams.AuthenticationStream.Subscribe(auth =>
                    {
                        received = auth;
                        receivedEvent.Set();
                    });

                    await communicator.Start();

                    await client.Authenticate(API_KEY, API_SECRET);

                    receivedEvent.WaitOne(TimeSpan.FromSeconds(30));

                    Assert.NotNull(received);
                    Assert.True(received.Success);
                }
            }
        }
        private static async Task <ICryptoOrders> StartBitmex(bool isTestnet, Action <CryptoOrder> handler,
                                                              Action <CryptoWallet[]> walletHandler, Action <CryptoPosition[]> positionHandler)
        {
            var url          = isTestnet ? BitmexValues.ApiWebsocketTestnetUrl : BitmexValues.ApiWebsocketUrl;
            var communicator = new BitmexWebsocketCommunicator(url)
            {
                Name = "Bitmex"
            };
            var client = new BitmexWebsocketClient(communicator);

            var source = new BitmexOrderSource(client);
            var orders = new CryptoOrders(source);

            orders.OrderChangedStream.Subscribe(handler);

            var walletSource = new BitmexWalletSource(client);

            walletSource.WalletChangedStream.Subscribe(walletHandler);

            var positionSource = new BitmexPositionSource(client);

            positionSource.PositionsStream.Subscribe(positionHandler);

            client.Streams.AuthenticationStream.Subscribe(x =>
            {
                Log.Information($"[Bitmex] Authenticated '{x.Success}'");
                client.Send(new Bitmex.Client.Websocket.Requests.WalletSubscribeRequest());
                client.Send(new Bitmex.Client.Websocket.Requests.MarginSubscribeRequest());
                client.Send(new Bitmex.Client.Websocket.Requests.PositionSubscribeRequest());
                client.Send(new Bitmex.Client.Websocket.Requests.OrderSubscribeRequest());
            });

            communicator.ReconnectionHappened.Subscribe(x =>
            {
                client.Authenticate(API_KEY, API_SECRET);
            });

            await communicator.Start();


            return(orders);
        }