Ejemplo n.º 1
0
        public void ExceptionsCannotPercolateFromEvaluatorsToEventManager()
        {
            var messages = Substitute.For <IMessageManager>();
            var settings = Substitute.For <ISettingsStore>();
            var uimap    = Substitute.For <IUIMap>();

            uimap.GetTime().Returns(new Time());
            var db           = Substitute.For <IAuroraDB>();
            var executor     = Substitute.For <IQueryExecutor>();
            var eventManager = new EventManager(uimap, settings, messages, db, executor);

            var evaluator = Substitute.For <IEvaluator>();

            evaluator.When(x => x.Execute()).Do(x => { throw new Exception(); });
            eventManager.AddEvent(evaluator);

            Assert.DoesNotThrow(() => eventManager.ActOnActiveTimelineEntries());
        }
Ejemplo n.º 2
0
        public void ProcessEventsOnTimelineWithoutControlLoop()
        {
            var messages = Substitute.For <IMessageManager>();
            var settings = Substitute.For <ISettingsStore>();
            var uimap    = Substitute.For <IUIMap>();

            uimap.GetTime().Returns(new Time());
            var db           = Substitute.For <IAuroraDB>();
            var executor     = Substitute.For <IQueryExecutor>();
            var eventManager = new EventManager(uimap, settings, messages, db, executor);

            var evaluator = Substitute.For <IEvaluator>();

            eventManager.AddEvent(evaluator);

            evaluator.Received(0).Execute();
            eventManager.ActOnActiveTimelineEntries();
            evaluator.Received(1).Execute();
        }