public void IsDisposedShouldBeTrue() { var stub = new DisposableObjectStub(); stub.Dispose(); Assert.That(stub.IsDisposed, Is.True); }
public void DisposingUnmanagedResourcesShouldBeCalled() { var stub = new DisposableObjectStub(); stub.Dispose(); Assert.That(stub.IsDisposingUnmanagedResourcesCalled, Is.True); }
public void DisposingShouldBeFired() { var testHelper = new GenericEventListener<EventArgs>(); using (var stub = new DisposableObjectStub()) { stub.Disposing += testHelper.Listen; } Assert.That(testHelper.HasBeenRaised, Is.True); Assert.That(testHelper.RaiseCounter, Is.EqualTo(1)); }
public void OnDisposingShouldBeCalled() { var stub = new DisposableObjectStub(); stub.Dispose(); Assert.That(stub.IsOnDisposingBeenCalled, Is.True); }
public void OnlyDisposingUnmanagedResourcesShouldBeCalled() { var stub = new DisposableObjectStub(); stub.InvokePrivateMethod("Dispose", new[] { typeof(bool) }, false); Assert.That(stub.IsDisposingUnmanagedResourcesCalled, Is.True); Assert.That(stub.IsDisposingManagedResourcesCalled, Is.False); }