Beispiel #1
0
        // [InlineData(0, 1, "0", 10, 1, 20, "create_date", null, "btc-usdt")]
        // [InlineData(0, 1, "0", 10, 1, 20, "create_date", "BTC-HUSD", null)]
        // [InlineData(0, 1, "0", 10, 1, 20, "create_date", null, "btc-husd")]
        public void CrossGetHisOrderTest(int tradeType, int type, string status,
                                         int createdDate, int?pageIndex, int?pageSize, string sortBy,
                                         string contractCode, string pair)
        {
            var result = client.CrossGetHisOrderAsync(tradeType, type, status, createdDate, pageIndex, pageSize, sortBy, contractCode, pair).Result;
            var strret = JsonConvert.SerializeObject(result, Formatting.Indented);

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

            if (pair != null)
            {
                tp = pair.Split("-")[1].ToUpper();
            }
            if (contractCode != null)
            {
                tp = contractCode.Split("-")[1].ToUpper();
            }
            foreach (var item in result.data.orders)
            {
                Assert.Equal(tp, item.tradePartition);
            }
            Console.WriteLine("------------");
        }
Beispiel #2
0
        public void GetHisOrderTest(string contractCode, int tradeType, int type, string status,
                                    int createdDate, int?pageIndex, int?pageSize)
        {
            var    result = client.IsolatedGetHisOrderAsync(contractCode, tradeType, type, status, createdDate, pageIndex, pageSize).Result;
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

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

            result = client.CrossGetHisOrderAsync(contractCode, tradeType, type, status, createdDate, pageIndex, pageSize).Result;
            strret = JsonConvert.SerializeObject(result, Formatting.Indented);
            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);
        }