コード例 #1
0
        public void CallProtectedMethodDisposingUnmanagedResourcesWhenUserCodeCallsDispose()
        {
            DisposableObjectStub stub = new DisposableObjectStub();

            stub.Dispose();

            Assert.That(stub.IsDisposingUnmanagedResourcesCalled, Is.True);
        }
コード例 #2
0
        public void CallProtectedMethodOnDisposingWhenUserCodeCallsDispose()
        {
            DisposableObjectStub stub = new DisposableObjectStub();

            stub.Dispose();

            Assert.That(stub.IsOnDisposingBeenCalled, Is.True);
        }
コード例 #3
0
        public void ReturnTrueWhenHittingIsDisposedGivenTheObjectIsDisposed()
        {
            DisposableObjectStub stub = new DisposableObjectStub();

            stub.Dispose();

            Assert.That(stub.IsDisposed, Is.True);
        }