Пример #1
0
        public void CrossGetPositionLimitTest(string contractCode, string businessType,
                                              string contractType, string pair,
                                              string tradePartition)
        {
            var    result = client.CrossGetPositionLimitAsync(contractCode, businessType, contractType, pair, tradePartition).Result;
            string 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();
            }
            if (type != null)
            {
                foreach (var item in result.data)
                {
                    Assert.Equal(type, item.tradePartition);
                }
            }
            Console.WriteLine("------------");
        }
        public void CrossGetPositionLimitTest(string contractCode)
        {
            var    result = client.CrossGetPositionLimitAsync(contractCode).Result;
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

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