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 DescendingKeySetWithLimit_lessThan(ConcurrentLinkedDictionary <int, int> map)
        {
            ISet <int> expected = new SortedSet <int>();

            for (int i = (int)Capacity(); i > 0; i--)
            {
                expected.Add(i);
            }
            Assert.That(map.DescendingKeySetWithLimit((int)Capacity() * 2), Is.EqualTo(expected));
        }
Beispiel #3
0
        public void DescendingKeySetWithLimit_snapshot(ConcurrentLinkedDictionary <int, int> map)
        {
            ISet <int> expected = new SortedSet <int>();

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

            ISet <int> original = map.DescendingKeySetWithLimit((int)Capacity() / 2);

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

            Assert.That(original, Is.EqualTo(expected));
        }
Beispiel #4
0
 public void DescendingKeySetWithLimit_negative(ConcurrentLinkedDictionary <int, int> map)
 {
     map.DescendingKeySetWithLimit(-1);
 }
Beispiel #5
0
 public void DescendingKeySetWithLimit_zero(ConcurrentLinkedDictionary <int, int> map)
 {
     Assert.That(map.DescendingKeySetWithLimit(0), emptyCollection <int>());
 }