Example #1
0
        public virtual void TestConsumeAll()
        {
            int capacity = 64;
            // arbitrary
            SinkQueue <int> q = new SinkQueue <int>(capacity);

            for (int i = 0; i < capacity; ++i)
            {
                Assert.True("should enqueue", q.Enqueue(i));
            }
            Assert.True("should not enqueue", !q.Enqueue(capacity));
            Runnable trigger = Org.Mockito.Mockito.Mock <Runnable>();

            q.ConsumeAll(new _Consumer_136(trigger));
            Org.Mockito.Mockito.Verify(trigger, Org.Mockito.Mockito.Times(capacity)).Run();
        }