public void CountTestCase()
        {
            const int numThread = 5;

            ParallelTestHelper.ParallelAdder(queue, numThread);
            Assert.AreEqual(10 * numThread, queue.Count, "#1");
            int value;

            queue.TryPeek(out value);
            ParallelTestHelper.ParallelRemover(queue, numThread, 3);
            Assert.AreEqual(10 * numThread - 3, queue.Count, "#2");
        }
Exemple #2
0
        public void CountTestCase()
        {
            const int numThread = 5;

            ParallelTestHelper.ParallelAdder(stack, numThread);
            Assert.AreEqual(10 * numThread, stack.Count, "#1");
            int value;

            stack.TryPeek(out value);
            ParallelTestHelper.ParallelRemover(stack, numThread, 3);
            Assert.AreEqual(10 * numThread - 3, stack.Count, "#2");
            stack.Clear();
            Assert.AreEqual(0, stack.Count, "#3");
            Assert.IsTrue(stack.IsEmpty, "#4");
        }