Beispiel #1
0
        public void TestImmediateTrigger()
        {
            // Should fireStatementStopped right away, wait time set to zero
            _observer = new TimerIntervalObserver(0, _beginState, _evaluator);

            _scheduleService.Time = 0;
            _observer.StartObserve();
            Assert.AreEqual(_beginState, _evaluator.GetAndClearMatchEvents()[0]);
            _scheduleService.Time = 10000000;
            SupportSchedulingServiceImpl.EvaluateSchedule(_scheduleService);
            Assert.AreEqual(0, _evaluator.GetAndClearMatchEvents().Count);
        }
Beispiel #2
0
        public void SetUp()
        {
            _beginState = new MatchedEventMapImpl(new MatchedEventMapMeta(new String[0], false));

            _scheduleService = new SchedulingServiceImpl(new TimeSourceServiceImpl());
            StatementContext stmtContext = SupportStatementContextFactory.MakeContext(_scheduleService);

            _context      = new PatternContext(stmtContext, 1, new MatchedEventMapMeta(new String[0], false), false);
            _agentContext = SupportPatternContextFactory.MakePatternAgentInstanceContext(_scheduleService);

            _evaluator = new SupportObserverEvaluator(_agentContext);

            _observer = new TimerIntervalObserver(1000, _beginState, _evaluator);
        }