Пример #1
0
        public void RemoveUndefinedTest(int index)
        {
            var collection = new AvoidingLargeObjectHeapCollection <int>(_getEnumerable(50000));

            Assert.False(collection.Remove(index));
            Assert.Equal(50000, collection.Count);
        }
Пример #2
0
        public void RemoveTest(int index)
        {
            var collection = new AvoidingLargeObjectHeapCollection <int>(_getEnumerable(50000));

            Assert.True(collection.Remove(index));
            Assert.Equal(49999, collection.Count);
            if (index > 0)
            {
                Assert.Equal(index - 1, collection[index - 1]);
            }
            if (index < 49999)
            {
                Assert.Equal(index + 1, collection[index]);
            }
        }