Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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(2100);
            processor.Stop();

            Assert.AreEqual(1, poller.Count);
        }