Example #1
0
        public void GetHisMatchTest(string contractCode, int tradeType, int createdDate, int?pageIndex, int?pageSize)
        {
            var    result = client.IsolatedGetHisMatchAsync(contractCode, tradeType, createdDate, pageIndex, pageSize).Result;
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

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

            result = client.CrossGetHisMatchAsync(contractCode, tradeType, createdDate, pageIndex, pageSize).Result;
            strret = JsonConvert.SerializeObject(result, Formatting.Indented);
            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);
        }
Example #2
0
        // [InlineData(0, 1, 1, 20, null, "btc-usdt")]
        // [InlineData(0, 1, null, null, "BTC-HUSD", null)]
        // [InlineData(0, 1, 1, 20, null, "btc-husd")]
        public void CrossGetHisMatchTest(int tradeType, int createdDate, int?pageIndex, int?pageSize, string contractCode, string pair)
        {
            var result = client.CrossGetHisMatchAsync(tradeType, createdDate, pageIndex, pageSize, 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.trades)
            {
                Assert.Equal(tp, item.tradePartition);
            }
            Console.WriteLine("------------");
        }