public void DisposeMustDisposeWhenCalled() { DelegatingServiceProvider provider = new DelegatingServiceProvider(null, () => { }); Assert.False(provider.IsDisposed); provider.Dispose(); Assert.True(provider.IsDisposed); }
public void DatabaseProviderMustDisposeWhenDisposeCalled() { DatabaseFacadeStub database = (DatabaseFacadeStub) new FakeDbContext().Database; DelegatingServiceProvider provider = ReflectionHelper.GetProperty <DelegatingServiceProvider>(database, "Provider"); provider.Dispose(); Assert.True(ReflectionHelper.GetProperty <bool>(provider, "IsDisposed")); }