public void TestNoEvents()
        {
            CountdownEvent latch = new CountdownEvent(1);
            IObserver <HystrixCommandCompletion> subscriber = new LatchedObserver(latch);

            commandStream.Observe().Take(1).Subscribe(subscriber);

            // no writes
            Assert.False(latch.Wait(TimeSpan.FromMilliseconds(1000)));
        }
Example #2
0
        public void NoEvents()
        {
            CountdownEvent commandLatch    = new CountdownEvent(1);
            CountdownEvent threadPoolLatch = new CountdownEvent(1);

            IObserver <HystrixCommandCompletion> commandSubscriber = new LatchedObserver <HystrixCommandCompletion>(commandLatch);

            readCommandStream.Observe().Take(1).Subscribe(commandSubscriber);

            IObserver <HystrixCommandCompletion> threadPoolSubscriber = new LatchedObserver <HystrixCommandCompletion>(threadPoolLatch);

            readThreadPoolStream.Observe().Take(1).Subscribe(threadPoolSubscriber);

            // no writes
            Assert.False(commandLatch.Wait(TimeSpan.FromMilliseconds(1000)));
            Assert.False(threadPoolLatch.Wait(TimeSpan.FromMilliseconds(1000)));
        }