Exemple #1
0
        public OrderBook getOrderBook()
        {
            var response = _api.GetOrderBook(_productId);
            var asks     = new List <OrderBookOrder>();
            var bids     = new List <OrderBookOrder>();

            foreach (var item in response.Data.BuyPriceLevels)
            {
                if (item.Amount < 100)
                {
                    continue;
                }
                bids.Add(new OrderBookOrder((float)item.Price, (float)item.Amount));
            }
            foreach (var item in response.Data.SellPriceLevels)
            {
                if (item.Amount < 100)
                {
                    continue;
                }
                asks.Add(new OrderBookOrder((float)item.Price, (float)item.Amount));
            }

            return(new OrderBook(asks, bids));
        }
        public void Should_Return_OrderBook(int id)
        {
            var result = client.GetOrderBook(id, true);

            Assert.True(result.Success);
            Assert.True(result.Data != null);
            Assert.True(result.Data.SellPriceLevels.Any() || result.Data.BuyPriceLevels.Any());
        }