public void Dispose_EmptyList_ShouldDoNothing() { //Setup var sut = new DisposableList<IDisposable>(); //Exercise sut.Dispose(); //Verify sut.Should().BeEmpty(); }
public void Dispose_EmptyList_ShouldDoNothing() { //Setup var sut = new DisposableList <IDisposable>(); //Exercise sut.Dispose(); //Verify sut.Should().BeEmpty(); }
public void Dispose_ListWithManyItems_ShouldDisposeAllItems( IEnumerable<IDisposable> items) { //Setup var sut = new DisposableList<IDisposable>(); sut.AddRange(items); //Exercise sut.Dispose(); //Verify sut.Should().NotBeEmpty(); sut.ForEach(item => Mock.Get(item).Verify(x => x.Dispose())); }
public void Dispose_ListWithManyItems_ShouldDisposeAllItems( IEnumerable <IDisposable> items) { //Setup var sut = new DisposableList <IDisposable>(); sut.AddRange(items); //Exercise sut.Dispose(); //Verify sut.Should().NotBeEmpty(); sut.ForEach(item => Mock.Get(item).Verify(x => x.Dispose())); }