public EventIntegrationService(IEventAggregator eventAggregator,
            BinaryEventSerializer eventSerializer,
            BinaryEventDeSerializer binaryEventDeSerializer,
            EventIntegrationRepositoryFake eventIntegrationRepositoryFake)
        {
            this.eventAggregator = eventAggregator;
            this.eventSerializer = eventSerializer;
            this.binaryEventDeSerializer = binaryEventDeSerializer;
            this.eventIntegrationRepositoryFake = eventIntegrationRepositoryFake;
            this.eventAggregator.Subscribe(this);

            subscriptions = new List<string>();
            cancellationToken = new CancellationToken(false);

            Task.Factory.StartNew(StartPolling, cancellationToken);

            Thread.Sleep(1000);
        }
        public void Setup()
        {
            //arrange
            startDate = DateTime.Now.AddMinutes(2);
            endDate = DateTime.Now.AddMinutes(3);
            isOpen = false;
            concurrentScrapingLimit = 1;
            billingCompanyId = Guid.NewGuid();

            eventSerializer = new BinaryEventSerializer();
            eventDeSerializer = new BinaryEventDeSerializer();
        }