예제 #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);
        }