diff --git a/src/client/spark_test/System/LimitsTests.cs b/src/client/spark_test/System/LimitsTests.cs index b517765bd..36a2235fe 100644 --- a/src/client/spark_test/System/LimitsTests.cs +++ b/src/client/spark_test/System/LimitsTests.cs @@ -124,10 +124,16 @@ namespace bts.tests over_limit_order_key = over_limit_order_result.value.OrderKey; no_limit_order_key = no_limit_order_result.value.OrderKey; + bool waiting_for_orders = true; + var orders = _order_service.subscribei_orders().Subscribe(ords => { + waiting_for_orders = false; + IEnumerable filtered_orders = ords.all.Where(x => x.Key == under_limit_order_key || x.Key == over_limit_order_key || x.Key == no_limit_order_key); + Assert.IsTrue(filtered_orders.Count() == 3, "There should be 3 matching orders... there are not"); + foreach(var o in filtered_orders) { if(o.Key == under_limit_order_key) { @@ -142,6 +148,9 @@ namespace bts.tests } }); + while(waiting_for_orders) { + await Task.Delay(100); + } // Restore the Limits to the original values bool success = false;