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); }
private void SetupEventToPublishSerializer() { _eventToPublishSerializer = Substitute.For <IEventToPublishSerializer>(); _eventToPublishSerializer.Deserialize(_eventToPublish).Returns(_event); }