예제 #1
0
        // [InlineData("BTC-HUSD", false, null, null, "HUSD")]
        // [InlineData("BTC-HUSD", false, null, null, "ALL")]
        // [InlineData(null, true, null, null, null)]
        // [InlineData(null, true, "swap", "btc-usdt", null)]
        // [InlineData(null, true, "swap", "btc-husd", "husd")]
        // [InlineData("BTC-USDT", true, null, null, null)]
        // [InlineData("BTC-HUSD", true, null, null, "HUSD")]
        // [InlineData("BTC-HUSD", true, null, null, "all")]
        public void CrossGetPositionInfoTest(string contractCode, bool beSubUid,
                                             string contractType, string pair,
                                             string tradePartition)
        {
            GetPositionInfoResponse result;

            if (beSubUid)
            {
                result = client.CrossGetPositionInfoAsync(contractCode, long.Parse(config["SubUid"]), contractType, pair, tradePartition).Result;
            }
            else
            {
                result = client.CrossGetPositionInfoAsync(contractCode, null, contractType, pair, tradePartition).Result;
            }
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);
            if (contractCode != null)
            {
                string type = contractCode.Split("-")[1].ToUpper();
                foreach (var item in result.data)
                {
                    Assert.Equal(type, item.tradePartition);
                }
            }
            Console.WriteLine("------------");
        }
        public void CrossGetPositionInfoTest(string contractCode, bool beSubUid)
        {
            GetPositionInfoResponse result;

            if (beSubUid)
            {
                result = client.CrossGetPositionInfoAsync(contractCode, long.Parse(config["SubUid"])).Result;
            }
            else
            {
                result = client.CrossGetPositionInfoAsync(contractCode).Result;
            }
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

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