Beispiel #1
0
 public void drain_blocksDescendingKeySet(ConcurrentLinkedDictionary <int, int> map)
 {
     checkDrainBlocks(map, () => {
         map.DescendingKeySet();
     });
     checkDrainBlocks(map, () => {
         map.DescendingKeySetWithLimit((int)Capacity());
     });
 }
Beispiel #2
0
        public void DescendingKeySet(ConcurrentLinkedDictionary <int, int> map)
        {
            ISet <int> expected = new SortedSet <int>();

            for (int i = (int)Capacity(); i > 0; i--)
            {
                expected.Add(i);
            }

            Assert.That(map.DescendingKeySet(), Is.EqualTo(expected));
        }
Beispiel #3
0
        public void DescendingKeySet_snapshot(ConcurrentLinkedDictionary <int, int> map)
        {
            ISet <int> expected = new SortedSet <int>();

            for (int i = (int)Capacity(); i > 0; i--)
            {
                expected.Add(i);
            }

            ISet <int> original = map.DescendingKeySet();

            map.put((int)Capacity(), (int)-Capacity());

            Assert.That(original, Is.EqualTo(original));
        }