Example #1
0
        public void FinalizeMethod()
        {
            var state = TestDisposable.CreateFinalizable();

            Finalizer.RunUntil(() => state.IsDisposed);

            state.IsFinalized.Should().BeTrue();
        }
        public void AddDisposable_Collect_ThenDispose()
        {
            var pool = new DisposablePool();

            (var refA, var refB) = AddGarbageToPool(pool);

            Finalizer.RunUntil(() => !refA.IsAlive && !refB.IsAlive);

            pool.Dispose();
        }