public void testCanPopulateParametersFromSystemIdWithStoId() { var gui = new FakeResearchGUI(); gui.setSystemId("178114"); gui.loadSystem(); gui.doAllWork(); var details = SystemDetailsTable.DETAILS.details(178114); var markets = O.list <string>(MsivBacktestTable.BACKTEST.markets(details.siv(), details.stoId())); AreEqual(O.sort(markets), O.sort(gui.markets())); var parameters = gui.parameters(); AreEqual(178114, parameters.get <int>("systemId")); AreEqual("0", parameters.get <string>("LeadBars")); AreEqual("0", parameters.get <string>("NumDevsDn")); IsTrue(gui.runNumberEnabled()); IsTrue(gui.runInNativeCurrency()); gui.setRunNumber("4"); gui.loadSystem(); gui.doAllWork(); parameters = gui.parameters(); AreEqual(178114, parameters.get <int>("systemId")); AreEqual("0", parameters.get <string>("LeadBars")); AreEqual("4", parameters.get <string>("LengthDn")); }
public void testLoadSystemFailsRight() { var gui = new FakeResearchGUI(); gui.setSystemId("asdf"); gui.loadSystem(); gui.doAllWork(); gui.hasMessage("failed"); }
public void testCanPopulateParametersFromSystemIdNoPvNoStoId() { var gui = new FakeResearchGUI(); gui.setSystemId("133486"); gui.loadSystem(); gui.doAllWork(); var parameters = gui.parameters(); AreEqual(133486, parameters.get <int>("systemId")); AreEqual("0", parameters.get <string>("LeadBars")); AreEqual("0", parameters.get <string>("closeBetter")); IsFalse(gui.runNumberEnabled()); AreEqual(new List <string>(), gui.markets()); }
public void testCanPopulateStuffFromSystemIdLive() { O.freezeNow("2009/04/28"); var gui = new FakeResearchGUI(); gui.setSystemId("39"); gui.loadSystem(); gui.doAllWork(); var parameters = gui.parameters(); AreEqual(39, parameters.get <int>("systemId")); AreEqual(50, parameters.get <int>("LeadBars")); AreEqual(30, parameters.get <int>("BreakDays")); IsTrue(gui.runNumberEnabled()); IsFalse(gui.runInNativeCurrency()); var markets = O.convert(O.list <Market>(SystemDetailsTable.DETAILS.details(39).liveSystem().markets()), m => m.name()); AreEqual(O.list(markets), gui.markets()); }