示例#1
0
        public void testTick()
        {
            O.freezeNow("2008/08/08 11:00:00");
            StatusTracker.LATE_MILLIS    = 500;
            StatusTracker.CRASHED_MILLIS = 500;
            var tracker = startGui();

            AreEqual(SystemStatus.UNKNOWN, gui.tickStatus(system));
            message("2008/08/08 11:00:00", "2008/08/08 10:00:00");
            waitForTickStatus(SystemStatus.GREEN);
            O.advanceNow(1000);

            Log.setFile(@"C:\foo.log");
            SYMBOL.publish(new Bar(0, 0, 0, 0, date("2008/08/08 11:00:01")));
            O.wait(() => tracker.tickTimers[system].running());
            O.advanceNow(500);
            waitForTickStatus(SystemStatus.YELLOW);
            O.advanceNow(500);
            waitForTickStatus(SystemStatus.RED);
            O.advanceNow(59000);
            message("2008/08/08 11:01:00", "2008/08/08 11:00:01");
            waitForTickStatus(SystemStatus.GREEN);
            // lastTickProcessed should be the time on the tick
        }
示例#2
0
 static void tick(Simulator simulator, Bar current, Symbol symbol)
 {
     symbol.publish(current);
     simulator.waitForTick();
 }