Пример #1
0
        public void DisposeNativeResourcesDisposed_Finalize()
        {
            var nativeResourcesDisposed = false;

            CreateDisposableInstance(null, () => nativeResourcesDisposed = true);
            GCHelper.TriggerGC();
            Assert.True(nativeResourcesDisposed);
        }
Пример #2
0
        public void DisposeManagedResources_Finalize()
        {
            var managedResourcesDisposed = false;

            CreateDisposableInstance(() => managedResourcesDisposed = true, null);
            GCHelper.TriggerGC();
            Assert.False(managedResourcesDisposed);
        }