コード例 #1
0
        public void RESTfulMarketTradeStatusTest(string contractCode, string businessType,
                                                 string contractType, string pair,
                                                 string tradePartition)
        {
            var    result = client.CrossGetTradeStateAsync(contractCode, businessType, contractType, pair, tradePartition).Result;
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);
            if (tradePartition == null || tradePartition.ToLower() == "usdt")
            {
                foreach (var item in result.data)
                {
                    Assert.Equal("USDT", item.tradePartition);
                }
            }
            else if (tradePartition.ToLower() == "husd")
            {
                foreach (var item in result.data)
                {
                    Assert.Equal("HUSD", item.tradePartition);
                }
            }
            else if (tradePartition.ToLower() == "all")
            {
                string type = pair.Split("-")[1].ToUpper();
                foreach (var item in result.data)
                {
                    Assert.Equal(type, item.tradePartition);
                }
            }
            Console.WriteLine("------------");
        }
コード例 #2
0
        public void RESTfulMarketTradeStatusTest(string contractCode)
        {
            var    result = client.CrossGetTradeStateAsync(contractCode).Result;
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

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