コード例 #1
0
        public void Dispose_EmptyList_ShouldDoNothing()
        {
            //Setup
            var sut = new DisposableList<IDisposable>();

            //Exercise
            sut.Dispose();

            //Verify
            sut.Should().BeEmpty();
        }
コード例 #2
0
        public void Dispose_EmptyList_ShouldDoNothing()
        {
            //Setup
            var sut = new DisposableList <IDisposable>();

            //Exercise
            sut.Dispose();

            //Verify
            sut.Should().BeEmpty();
        }
コード例 #3
0
        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()));
        }
コード例 #4
0
        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()));
        }