Пример #1
0
 public void DisposeCalled()
 {
     var disposable = new MockDisposable();
     Assert.AreEqual(0, disposable.DisposeCalled);
     disposable.Dispose();
     Assert.AreEqual(1, disposable.DisposeCalled);
     disposable.Dispose();
     Assert.AreEqual(1, disposable.DisposeCalled);
 }
Пример #2
0
        public void DisposeCalled()
        {
            var disposable = new MockDisposable();

            Assert.AreEqual(0, disposable.DisposeCalled);
            disposable.Dispose();
            Assert.AreEqual(1, disposable.DisposeCalled);
            disposable.Dispose();
            Assert.AreEqual(1, disposable.DisposeCalled);
        }
Пример #3
0
        public void TestMock()
        {
            var d1 = new MockDisposable();

            Assert.IsFalse(d1.Disposed);
            d1.Dispose();
            Assert.IsTrue(d1.Disposed);
        }