Ejemplo n.º 1
0
        public void GetOpenOrderTest(string contractCode, int pageIndex, int pageSize, string sortBy, int tradeType)
        {
            var    result = client.IsolatedGetOpenOrderAsync(contractCode, pageIndex, pageSize, sortBy, tradeType).Result;
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);

            result = client.CrossGetOpenOrderAsync(contractCode, pageIndex, pageSize, sortBy, tradeType).Result;
            strret = JsonConvert.SerializeObject(result, Formatting.Indented);
            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);
        }
Ejemplo n.º 2
0
        // [InlineData(1, 10, "created_at", 0, null, "btc-usdt", null)]
        // [InlineData(1, 10, "created_at", 0, "BTC-HUSD", "btc-husdt", "husd")]
        // [InlineData(1, 10, "created_at", 0, null, "btc-husd", "husd")]
        // [InlineData(1, 10, "created_at", 0, null, "btc-husd", "all")]
        public void CrossGetOpenOrderTest(int pageIndex, int pageSize, string sortBy, int tradeType,
                                          string contractCode, string pair, string tradePartition)
        {
            var result = client.CrossGetOpenOrderAsync(pageIndex, pageSize, sortBy, tradeType, contractCode, pair, tradePartition).Result;
            var strret = JsonConvert.SerializeObject(result, Formatting.Indented);

            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);
            string type = null;

            if (pair != null)
            {
                type = pair.Split("-")[1].ToUpper();
            }
            if (contractCode != null)
            {
                type = contractCode.Split("-")[1].ToUpper();
            }
            foreach (var item in result.data.orders)
            {
                Assert.Equal(type, item.tradePartition);
            }
            Console.WriteLine("------------");
        }