示例#1
0
        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));
        }
示例#2
0
        public void SetCapacity(int capacity)
        {
            var pipe = new Pipe <int>(capacity);

            pipe.AddRange(Enumerable.Range(0, capacity));
            Assert.Equal(capacity, pipe.Count());
        }