Пример #1
0
        public void LocalDisposables_Test2()
        {
            var sut = new LocalDisposables();
            var d   = sut.AddUsingValue(UsingValue.CreateByFunction(() => new Dummy()));

            Assert.False(d.IsDisposed);
            sut.Dispose();
            Assert.True(d.IsDisposed);
        }
Пример #2
0
        public void LocalDisposables_Test1()
        {
            var d = new Dummy();

            Assert.False(d.IsDisposed);
            var sut = new LocalDisposables();
            var d2  = sut.Add(d);

            Assert.Same(d, d2);
            sut.Dispose();
            Assert.True(d.IsDisposed);
        }