public void RemoveUndefinedTest(int index) { var collection = new AvoidingLargeObjectHeapCollection <int>(_getEnumerable(50000)); Assert.False(collection.Remove(index)); Assert.Equal(50000, collection.Count); }
public void GettingIndexOutOfRangeExceptionTest(int index) { var collection = new AvoidingLargeObjectHeapCollection <int>(_getEnumerable(50000)); int result; Assert.Throws <IndexOutOfRangeException>(() => result = collection[index]); }
public void CopyToTest() { var collection = new AvoidingLargeObjectHeapCollection <int>(_getEnumerable(3)); var dest = new int[10]; collection.CopyTo(dest, 5); Assert.Equal(new int[] { 0, 0, 0, 0, 0, 0, 1, 2, 0, 0 }, dest); }
public void SetValueByIndexTest(int index) { var collection = new AvoidingLargeObjectHeapCollection <int>(_getEnumerable(50000)); collection[index] = index * 2; Assert.Equal(index * 2, collection[index]); if (index > 0) { Assert.Equal(index - 1, collection[index - 1]); } }
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]); } }
public void GetValueByIndexTest(int index) { var collection = new AvoidingLargeObjectHeapCollection <int>(_getEnumerable(50000)); Assert.Equal(index, collection[index]); }
public void CountTest(int count) { var collection = new AvoidingLargeObjectHeapCollection <int>(_getEnumerable(count)); Assert.Equal(count, collection.Count); }