예제 #1
0
        public void ConsumeTest()
        {
            int num = 100000;
            ThreadQueue <int> threadQueue = new ThreadQueue <int>(100, streamOfIntegers(num));

            List <int> output = new List <int>();

            foreach (var i in threadQueue.Consume())
            {
                output.Add(i);
            }

            foreach (var i in streamOfIntegers(num))
            {
                Assert.AreEqual(output[i], i);
            }
        }