private static List <JournaledEvent> TakeNotificationFromListener(BatchEventListener listener, int numberEvents)
        {
            var events = new List <JournaledEvent>();

            foreach (var journaledEvent in listener.Events.GetConsumingEnumerable())
            {
                events.Add(journaledEvent);
            }

            return(events);
        }
        public EventStreamDeferedNotificationsTests()
        {
            BatchEventListener = new BatchEventListener();
            EventListener      = new EventListener();

            var queueName = Guid.NewGuid().ToString("N");

            StreamName = Guid.NewGuid().ToString("N");

            Connection = EventStoreConnectionBuilder
                         .Create(config => config
                                 .UseStorage(
                                     storageConnectionString: "UseDevelopmentStorage=true",
                                     journalTableName: "TestEventJournal" + Guid.NewGuid().ToString("N"),
                                     notificationQueuePartitionCount: 1,
                                     notificationQueueName: queueName)
                                 .Notifications.EnableProcessing()
                                 .Notifications.Subscribe(BatchEventListener)
                                 .Notifications.Subscribe(EventListener))
                         .Build();
        }