コード例 #1
0
        public void DisposeMustDisposeWhenCalled()
        {
            DelegatingServiceProvider provider = new DelegatingServiceProvider(null, () => { });

            Assert.False(provider.IsDisposed);
            provider.Dispose();
            Assert.True(provider.IsDisposed);
        }
コード例 #2
0
        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"));
        }