Esempio n. 1
0
        public void MatchOrdersTest(string contractCode)
        {
            WSNotifyClient client = new WSNotifyClient(config["AccessKey"], config["SecretKey"]);

            client.IsolatedSubMatchOrders(contractCode, delegate(SubOrdersResponse data)
            {
                Console.WriteLine(JsonConvert.SerializeObject(data));
            });
            System.Threading.Thread.Sleep(1000 * 15);
            client.IsolatedUnsubMathOrders(contractCode);
            System.Threading.Thread.Sleep(1000 * 15);

            client.CrossSubMatchOrders(contractCode, delegate(SubOrdersResponse data)
            {
                Console.WriteLine(JsonConvert.SerializeObject(data));
            });
            System.Threading.Thread.Sleep(1000 * 15);
            client.CrossUnsubMathOrders(contractCode);
            System.Threading.Thread.Sleep(1000 * 15);
        }
Esempio n. 2
0
        // [InlineData("btc-husd")]
        public void IsolatedMatchOrdersTest(string contractCode)
        {
            bool   has_data = false;
            string tp       = null;

            if (contractCode != "*")
            {
                tp = contractCode.Split("-")[1].ToUpper();
            }
            client.IsolatedSubMatchOrders(contractCode, delegate(SubOrdersResponse data)
            {
                Console.WriteLine(JsonConvert.SerializeObject(data));
                if (tp != null)
                {
                    Assert.Equal(tp, data.tradePartition);
                }
                has_data = true;
            });
            System.Threading.Thread.Sleep(1000 * 20);
            Assert.Equal(true, has_data);
            client.IsolatedUnsubMathOrders(contractCode);
            System.Threading.Thread.Sleep(1000 * 5);
        }