Inheritance: IPollProcessor
 public void TimerContinuesIfPollThrows()
 {
     var poller = new PollerImpl().ShouldThrow();
     var processor = new PollProcessor(new PollProcessorEndpoint { Name = "name", IntervalSecs = 1, Handler = typeof(PollerImpl) }, poller);
     processor.Start();
     Thread.Sleep(3000);
     processor.Stop();
     Assert.GreaterOrEqual(poller.Count, 2);
 }
 public void OnceStartedPollIsCalledOnTimer()
 {
     var poller = new PollerImpl();
     var processor = new PollProcessor(new PollProcessorEndpoint { Name = "name", IntervalSecs = 1, Handler = typeof(PollerImpl) }, poller);
     processor.Start();
     Thread.Sleep(3000);
     processor.Stop();
     Assert.GreaterOrEqual(poller.Count, 2);
 }
        public void WhenPollingInProgressThenPollingShouldNotBeCalledAgain()
        {
            var poller = new PollerImplWithDelay(1500);

            var processor = new PollProcessor(new PollProcessorEndpoint
            {
                Name = "Test",
                Handler = typeof(PollerImplWithDelay),
                IntervalSecs =1,
                SinglePolling = true,
                Workers = 1
            }, poller);

            processor.Start();
            Thread.Sleep(2400);
            processor.Stop();

            Assert.AreEqual(1, poller.Count);
        }
 public void PollProcessorName()
 {
     var processor = new PollProcessor(new PollProcessorEndpoint { Name = "name", IntervalSecs = 1, Handler = typeof(PollerImpl) }, new PollerImpl());
     Assert.AreEqual("name", processor.Name);
 }