public void OrdersTest(string contractCode) { WSNotifyClient client = new WSNotifyClient(config["AccessKey"], config["SecretKey"]); client.IsolatedSubOrders(contractCode, delegate(SubOrdersResponse data) { Console.WriteLine(JsonConvert.SerializeObject(data)); }); client.CrossSubOrders(contractCode, delegate(SubOrdersResponse data) { Console.WriteLine(JsonConvert.SerializeObject(data)); }); System.Threading.Thread.Sleep(1000 * 60 * 1); client.IsolatedUnsubOrders(contractCode); client.CrossUnsubOrders(contractCode); System.Threading.Thread.Sleep(1000 * 5); }
// [InlineData("BTC-HUSD")] // [InlineData("*")] public void IsolatedOrdersTest(string contractCode) { bool has_data = false; string tp = null; if (contractCode != "*") { tp = contractCode.Split("-")[1].ToUpper(); } client.IsolatedSubOrders(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 * 30); Assert.Equal(true, has_data); client.IsolatedUnsubOrders(contractCode); System.Threading.Thread.Sleep(1000 * 5); }