public void testCanPopulateDataTable() { var now = "2008/07/05 12:31:45"; Dates.freezeNow(now); addOrders(); var gui = new FakeOrderTrackerGUI(); var orderTable = gui.tracker.orderTable(); gui.setMarket("RE.TEST.TY.1C"); gui.doAllWork(); var row = O.first(orderTable.rows()); AreEqual("NDayBreak-daily-1.0", row["system"]); AreEqual("BFBD30", row["pv"]); AreEqual("RE.TEST.TY.1C", row["symbol"]); AreEqual(now, row["simFillTime"]); AreEqual("Enter short", row["enterExit"]); AreEqual("10,000", row["size"]); AreEqual("99.501235", row["simFillPrice"]); AreEqual("STOP(99.50)", row["details"]); AreEqual("an order", row["description"]); AreEqual("my pc", row["hostname"]); }
public void testFilterBasedOnSiv() { addOrders(); var gui = new FakeOrderTrackerGUI(); var orderTable = gui.tracker.orderTable(); gui.selectedSystem = "NDayBreak-daily-1.0"; gui.setMarket("RE.TEST.TY.1C"); gui.doAllWork(); AreEqual(2, orderTable.count()); O.each(orderTable.rows(), row => AreEqual("NDayBreak-daily-1.0", row["system"])); }
public void testUpdates() { addOrders(); var gui = new FakeOrderTrackerGUI(); gui.tracker.initialize(); gui.setMarket("RE.TEST.TY.1C"); gui.doAllWork(); AreEqual(3, gui.count()); addOrders(); fireOrdersReceived(); O.wait(() => { gui.doAllWork(); return(gui.count() == 6); }); fireOrdersReceived(); O.sleep(100); gui.doAllWork(); }
static FakeOrderTrackerGUI startGui() { OrderTable.prefix = "test"; var gui = new FakeOrderTrackerGUI(); var populateComplete = false; var lockObj = new object(); gui.tracker.orderTable().onPopulateComplete += () => { lock (lockObj) populateComplete = true; }; populateCompleted = () => { lock (lockObj) { var result = populateComplete; populateComplete = false; return(result); } }; gui.setMarket(SYMBOL); var tracker = gui.tracker; tracker.initialize(); gui.wait(populateCompleted); return(gui); }