Beispiel #1
0
        public void ConnectTest()
        {
            _wss.Setup(m => m.Connect()).Verifiable();
            _wss.Setup(m => m.IsOpen).Returns(true);

            _unit.Connect();
            _wss.Verify();
        }
Beispiel #2
0
 public void ConnectTest()
 {
     _wss.Setup(m => m.Connect()).Callback(() => { _wss.Setup(m => m.IsOpen).Returns(true); }).Verifiable();
     _wss.Setup(m => m.IsOpen).Returns(false);
     _unit.Connect();
     _wss.Verify();
 }
        private static GDAXBrokerage GetBrokerage()
        {
            var wssUrl          = Config.Get("gdax-url", "wss://ws-feed.pro.coinbase.com");
            var webSocketClient = new WebSocketWrapper();
            var restClient      = new RestClient("https://api.pro.coinbase.com");
            var apiKey          = Config.Get("gdax-api-key");
            var apiSecret       = Config.Get("gdax-api-secret");
            var passPhrase      = Config.Get("gdax-passphrase");
            var algorithm       = new QCAlgorithm();

            var brokerage = new GDAXBrokerage(wssUrl, webSocketClient, restClient, apiKey, apiSecret, passPhrase, algorithm);

            brokerage.Connect();

            return(brokerage);
        }
Beispiel #4
0
        private static GDAXBrokerage GetBrokerage()
        {
            var wssUrl          = Config.Get("gdax-url", "wss://ws-feed.pro.coinbase.com");
            var webSocketClient = new WebSocketWrapper();
            var restClient      = new RestClient("https://api.pro.coinbase.com");
            var apiKey          = Config.Get("gdax-api-key");
            var apiSecret       = Config.Get("gdax-api-secret");
            var passPhrase      = Config.Get("gdax-passphrase");
            var algorithm       = new QCAlgorithm();
            var userId          = Config.GetInt("job-user-id");
            var userToken       = Config.Get("api-access-token");
            var priceProvider   = new ApiPriceProvider(userId, userToken);

            var brokerage = new GDAXBrokerage(wssUrl, webSocketClient, restClient, apiKey, apiSecret, passPhrase, algorithm, priceProvider);

            brokerage.Connect();

            return(brokerage);
        }