Ejemplo n.º 1
0
        public void ForEach_NullAction_ThrowsArgumentNullException()
        {
            PooledList <T> list = GenericListFactory();

            Assert.Throws <ArgumentNullException>(() => list.ForEach(null));
            list.Dispose();
        }
Ejemplo n.º 2
0
        public void Dispose()
        {
            GC.SuppressFinalize(this);

            if (_lines is not null)
            {
                _lines.ForEach(x => x?.Dispose());
                _lines.Dispose();
            }
        }
Ejemplo n.º 3
0
        public void ForEach_Verify(int count)
        {
            PooledList <T> list         = GenericListFactory(count);
            PooledList <T> visitedItems = new PooledList <T>();

            void action(T item)
            {
                visitedItems.Add(item);
            }

            //[] Verify ForEach looks at every item
            visitedItems.Clear();
            list.ForEach(action);
            VerifyList(list, visitedItems);

            list.Dispose();
            visitedItems.Dispose();
        }
 public virtual void Dispose()
 {
     _disposables.ForEach(d => d?.Dispose());
     _disposables.Dispose();
 }