Example #1
0
        public void WSLiquidationOrdersTest(string contractCode, string businessType, string tradePartition)
        {
            string tp = null;

            if (tradePartition == null || tradePartition.ToLower() == "usdt")
            {
                tp = "USDT";
            }
            else
            {
                tp = "HUSD";
            }
            WSNotifyClient client = new WSNotifyClient();

            client.SubLiquidationOrders(contractCode, delegate(SubLiquidationOrdersResponse data)
            {
                Console.WriteLine(JsonConvert.SerializeObject(data));
                foreach (var item in data.data)
                {
                    Assert.Equal(tp, item.tradePartition);
                }
            }, null, businessType, tradePartition);
            System.Threading.Thread.Sleep(1000 * 10);
            client.UnsubLiquidationOrders(contractCode, null, businessType, tradePartition);
            System.Threading.Thread.Sleep(1000 * 5);

            Console.WriteLine("------------");
        }
        //[InlineData("*")]
        public void WSLiquidationOrdersTest(string symbol)
        {
            WSNotifyClient client = new WSNotifyClient();

            client.SubLiquidationOrders(symbol, delegate(SubLiquidationOrdersResponse data)
            {
                Console.WriteLine(JsonConvert.SerializeObject(data));
            });
            System.Threading.Thread.Sleep(1000 * 1200);
            client.UnsubLiquidationOrders(symbol);
            System.Threading.Thread.Sleep(1000 * 5);
        }
Example #3
0
        //[InlineData("*")]
        public void WSLiquidationOrdersTest(string contractCode, string businessType)
        {
            WSNotifyClient client = new WSNotifyClient();

            client.SubLiquidationOrders(contractCode, delegate(SubLiquidationOrdersResponse data)
            {
                Console.WriteLine(JsonConvert.SerializeObject(data));
            }, null, businessType);
            System.Threading.Thread.Sleep(1000 * 60);
            client.UnsubLiquidationOrders(contractCode, null, businessType);
            System.Threading.Thread.Sleep(1000 * 5);

            Console.WriteLine("------------");
        }