public void RunTestsThread() { try { while (true) { lock (TimeoutOrders) { //1- Ok order DoLog(string.Format("Sending full regular order @{0}", Configuration.Name), Constants.MessageType.Information); Order fullOrder = OrderBuilder.BuildFullOrder(); NewOrderWrapper fullOrderWrapper = new NewOrderWrapper(fullOrder, Configuration); MessageOk.Add(fullOrder.ClOrdId, fullOrder); TimeoutOrders.Add(fullOrder.ClOrdId, DateTime.Now); ExecutionReportsReceived.Add(fullOrder.ClOrdId, 0); DoPublishMessage(fullOrderWrapper); } Thread.Sleep(2000); } } catch (Exception ex) { DoLog(string.Format("{0}-Critical error running tests:{1}", Configuration.Name, ex.Message), Constants.MessageType.Error); } }
public void RunTestsThread() { try { //1- Ok order DoLog(string.Format("Sending full regular order @{0}", Configuration.Name), Constants.MessageType.Information); Order fullOrder = OrderBuilder.BuildFullOrder(); NewOrderWrapper fullOrderWrapper = new NewOrderWrapper(fullOrder, Configuration); MessageOk.Add(fullOrder.ClOrdId, fullOrder); TimeoutOrders.Add(fullOrder.ClOrdId, DateTime.Now); DoPublishMessage(fullOrderWrapper); //2- Missing Mandatory tag test DoLog(string.Format("Sending missing tag order @{0}", Configuration.Name), Constants.MessageType.Information); Order missingTagOrder = OrderBuilder.BuildOrderMissingAccount(); NewOrderWrapper missingTagOrderWrapper = new NewOrderWrapper(missingTagOrder, Configuration); MissingTags.Add(missingTagOrder.ClOrdId, "1");//ClOrdId TimeoutOrders.Add(missingTagOrder.ClOrdId, DateTime.Now); DoPublishMessage(missingTagOrderWrapper); //3- Invalid Value tag test DoLog(string.Format("Sending invalid tag value @{0}", Configuration.Name), Constants.MessageType.Information); Order invalidValueOrder = OrderBuilder.BuildFullOrder(); invalidValueOrder.Side = Side.BuyToClose; NewOrderWrapper invalidValueOrderWrapper = new NewOrderWrapper(invalidValueOrder, Configuration); MissingTags.Add(invalidValueOrder.ClOrdId, "54");//Side TimeoutOrders.Add(invalidValueOrder.ClOrdId, DateTime.Now); DoPublishMessage(invalidValueOrderWrapper); } catch (Exception ex) { DoLog(string.Format("{0}-Critical error running tests:{1}", Configuration.Name, ex.Message), Constants.MessageType.Error); } }