예제 #1
0
 private void AssumingThereIsOneEventToPublish()
 {
     _eventToPublishRepository = Substitute.For <IEventToPublishRepository>();
     _eventToPublishRepository
     .GetEventsAwaitingPublishing()
     .Returns(new List <EventToPublish> {
         _eventToPublish
     });
 }
        public void PublishQueuedMessages()
        {
            var events = _eventToPublishRepository
                         .GetEventsAwaitingPublishing()
                         .Select(eventToPublish => _eventToPublishSerializer.Deserialize(eventToPublish))
                         .ToList();

            _logger.Debug($"Retrieved {events.Count} events to publish to message queue.");
            PublishEvents(events);
        }