예제 #1
0
 public void AddRangeEnumerableWorks()
 {
     var c = new FastCollection<int>();
     const int count = 10;
     var array = (IEnumerable<int>)Enumerable.Range(0, count).ToArray();
     c.AddRange(array, 10);
     AssertEquals(c, array);
     c.AddRange(array, 0);
     AssertEquals(c, array);
     c.Clear();
     Assert.Equal(0, c.Count);
     c.AddRange(array, 0);
     Assert.Equal(0, c.Count);
     c.AddRange(array, 2);
     AssertEquals(c, array.Take(2));
 }
예제 #2
0
 public void AddRangeArrayWorks()
 {
     var c = new FastCollection<int>();
     var array = Enumerable.Range(0, 10).ToArray();
     c.AddRange(array, 0, 10);
     AssertEquals(c, array);
     c.AddRange(array, 5, 0);
     AssertEquals(c, array);
     c.Clear();
     Assert.Equal(0, c.Count);
     c.AddRange(array, 0);
     Assert.Equal(0, c.Count);
     c.AddRange(array, 0, 2);
     AssertEquals(c, array.Take(2));
     c.AddRange(array, 2, 3);
     AssertEquals(c, array.Take(5));
 }
예제 #3
0
 public void AddRange(T[] tuples, int count)
 {
     _storage.AddRange(tuples, count);
 }