public void ForEach_NullAction_ThrowsArgumentNullException() { PooledList <T> list = GenericListFactory(); Assert.Throws <ArgumentNullException>(() => list.ForEach(null)); list.Dispose(); }
public void Dispose() { GC.SuppressFinalize(this); if (_lines is not null) { _lines.ForEach(x => x?.Dispose()); _lines.Dispose(); } }
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(); }