예제 #1
0
        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"));
        }
예제 #2
0
        public void testLoadSystemFailsRight()
        {
            var gui = new FakeResearchGUI();

            gui.setSystemId("asdf");
            gui.loadSystem();
            gui.doAllWork();
            gui.hasMessage("failed");
        }
예제 #3
0
        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());
        }
예제 #4
0
        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());
        }