Exemplo n.º 1
0
        public void TestReleasingTargetForExecuteGenericInternal()
        {
            _tempoInstance = new TemporaryClass();
            _reference     = new WeakReference(_tempoInstance);

            _tempoInstance.CreateCommandGenericInternal();

            Assert.IsTrue(_reference.IsAlive);

            _tempoInstance = null;
            GC.Collect();

            Assert.IsFalse(_reference.IsAlive);
        }
        public void TestReleasingTargetForExecuteGenericInternal()
        {
            _tempoInstance = new TemporaryClass();
            _reference = new WeakReference(_tempoInstance);

            _tempoInstance.CreateCommandGenericInternal();

            Assert.IsTrue(_reference.IsAlive);

            _tempoInstance = null;
            GC.Collect();

            Assert.IsFalse(_reference.IsAlive);
        }