public void Then_the_event_processors_for_client_moved_event_will_be_registered()
        {
            IEnumerable <EventProcessor> eventProcessors;

            EventProcessorCache.TryGetEventProcessorsFor(typeof(ClientMovedEvent), out eventProcessors);
            eventProcessors.Count().WillBe(1);
        }
Esempio n. 2
0
        private void apply(Type eventType, IDomainEvent domainEvent)
        {
            IEnumerable <EventProcessor> eventProcessors;

            if (!_eventProcessorCache.TryGetEventProcessorsFor(eventType, out eventProcessors))
            {
                throw new UnregisteredDomainEventException(string.Format("The requested class '{0}' is not registered as a domain event", eventType.FullName));
            }

            eventProcessors
            .ToList()
            .ForEach(eventProcessor => eventProcessor.ProcessorEventProperty(domainEvent, _internalState));
        }