Пример #1
0
        public void DisposeDisposesValue()
        {
            // Fixture setup
            var dummyLease = new Mock <ILease>().Object;
            var sut        = new CacheLifetimeManager(dummyLease);

            var valueMock = new Mock <IDisposable>();

            sut.SetValue(valueMock.Object);
            // Exercise system
            sut.Dispose();
            // Verify outcome
            valueMock.Verify(d => d.Dispose());
            // Teardown
        }
Пример #2
0
        public void DisposeRemovesValue()
        {
            // Fixture setup
            var dummyLease = new Mock <ILease>().Object;
            var sut        = new CacheLifetimeManager(dummyLease);

            sut.SetValue(new object());
            // Exercise system
            sut.Dispose();
            // Verify outcome
            var result = sut.GetValue();

            Assert.Null(result);
            // Teardown
        }
        public void DisposeDisposesValue()
        {
            // Fixture setup
            var dummyLease = new Mock<ILease>().Object;
            var sut = new CacheLifetimeManager(dummyLease);

            var valueMock = new Mock<IDisposable>();
            sut.SetValue(valueMock.Object);
            // Exercise system
            sut.Dispose();
            // Verify outcome
            valueMock.Verify(d => d.Dispose());
            // Teardown
        }
 public void DisposeRemovesValue()
 {
     // Fixture setup
     var dummyLease = new Mock<ILease>().Object;
     var sut = new CacheLifetimeManager(dummyLease);
     sut.SetValue(new object());
     // Exercise system
     sut.Dispose();
     // Verify outcome
     var result = sut.GetValue();
     Assert.Null(result);
     // Teardown
 }