public void KeepCapacityOnAddRange() { var pipe = new Pipe <int>(3); pipe.AddRange(Enumerable.Range(0, 3)); pipe.AddRange(Enumerable.Range(3, 2)); Assert.Equal(new int[] { 4, 3, 2 }, pipe.Select(x => x)); }
public void SetCapacity(int capacity) { var pipe = new Pipe <int>(capacity); pipe.AddRange(Enumerable.Range(0, capacity)); Assert.Equal(capacity, pipe.Count()); }