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 TestReleasingTargetForExecuteGeneric() { _tempoInstance = new TemporaryClass(); _reference = new WeakReference(_tempoInstance); TestCommand = new RelayCommand <string>( _tempoInstance.SetContent); Assert.IsTrue(_reference.IsAlive); _tempoInstance = null; GC.Collect(); Assert.IsFalse(_reference.IsAlive); }
public void TestReleasingTargetForCanExecute() { _tempoInstance = new TemporaryClass(); _reference = new WeakReference(_tempoInstance); TestCommand = new RelayCommand( _tempoInstance.SetContent, _tempoInstance.CheckEnabled); Assert.IsTrue(_reference.IsAlive); _tempoInstance = null; GC.Collect(); Assert.IsFalse(_reference.IsAlive); }
public void TestReleasingTargetForExecuteGeneric() { _tempoInstance = new TemporaryClass(); _reference = new WeakReference(_tempoInstance); TestCommand = new RelayCommand<string>( _tempoInstance.SetContent); Assert.IsTrue(_reference.IsAlive); _tempoInstance = null; GC.Collect(); Assert.IsFalse(_reference.IsAlive); }
public void TestReleasingTargetForCanExecuteGeneric() { _tempoInstance = new TemporaryClass(); _reference = new WeakReference(_tempoInstance); TestCommand = new RelayCommand<string>( _tempoInstance.SetContent, _tempoInstance.CheckEnabled); Assert.IsTrue(_reference.IsAlive); _tempoInstance = null; GC.Collect(); #if NETFX_CORE Assert.IsTrue(_reference.IsAlive); TestCommand = null; GC.Collect(); Assert.IsFalse(_reference.IsAlive); #else Assert.IsFalse(_reference.IsAlive); #endif }