Esempio n. 1
0
        public void GetOrderInfoTest(string contractCode, string orderId, string clientOrderId)
        {
            var    result = client.IsolatedGetOrderInfoAsync(contractCode, orderId, clientOrderId).Result;
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

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

            result = client.CrossGetOrderInfoAsync(contractCode, orderId, clientOrderId).Result;
            strret = JsonConvert.SerializeObject(result, Formatting.Indented);
            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);
        }
Esempio n. 2
0
        // [InlineData("932677638944722944", null, null, "btc-usdt")]
        // [InlineData("932677648528707584", null, null, "btc-usdt")]
        // [InlineData("932677646502858752", null, "BTC-USDT-220121", null)]
        // [InlineData("932677640777633792", null, "BTC-HUSD", null)]
        // [InlineData("932677642644107264", null, null, "btc-HUSD")]
        // [InlineData("932677650491650048", null, null, "btc-HUSD")]
        // [InlineData("932677644619624448", null, "BTC-HUSD-220121", null)]
        public void CrossGetOrderInfoTest(string orderId, string clientOrderId, string contractCode, string pair)
        {
            var result = client.CrossGetOrderInfoAsync(orderId, clientOrderId, contractCode, pair).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)
            {
                Assert.Equal(type, item.tradePartition);
            }
            Console.WriteLine("------------");
        }