diff --git a/src/client/spark_test/System/LimitsTests.cs b/src/client/spark_test/System/LimitsTests.cs index a37f6bce1..b517765bd 100644 --- a/src/client/spark_test/System/LimitsTests.cs +++ b/src/client/spark_test/System/LimitsTests.cs @@ -12,6 +12,7 @@ using bts.test; using bts.api.orderman; using mbts; using mbts.tests; +using bts.co2; namespace bts.tests { @@ -36,6 +37,39 @@ namespace bts.tests Disposable.dispose(ref _context); } + async Task> all_futures(string symbol) { + var request = new MDRequest() { + Host = "system_test", + Channels = { + new SecurityChannel() { + Time = 0, + Flags = 0, + Type = SecurityType.Future, + Exchange = Venue.Sim, + Symbol = symbol, + TradeCursor = 0, + RfqCursor = 0 + } + } + }; + + var relay = _context.locate(); + await Task.Delay(100); + var result = await relay.requestmd_async(request); + + List securities = new List(); + if (result.success) { + foreach (var ch in result.value.Channels) { + foreach (var update in ch.Updates) { + if (update.Security != null) { + securities.Add(new SecurityImmutable(update.Security)); + } + } + } + } + return securities; + } + [Test] public async Task test_clip_limits() { //Get and set limit values from the admin service @@ -53,9 +87,9 @@ namespace bts.tests //create Orders Here - bts.md.MarketDataClient mdc = new bts.md.MarketDataClient(); - - SecurityImmutable? sec = await mdc.find_security_async(y => y.Symbol == test_symbol && y.Exchange == Venue.Sim); + var all = await all_futures(test_symbol); + SecurityImmutable? sec = all.FirstOrDefault(); + Assert.IsTrue(sec.HasValue); uint under_limit_order_key; uint over_limit_order_key;