public void Not_Collect_With_Parameterized_Method() { var c = new MyWeakClass(); var w = new WeakDelegate((Action <string>)c.MyMethod, false); GC.Collect(); Assert.IsNotNull(w.Target); }
public void Not_Collect_With_Method() { var c = new MyWeakClass(); var w = new WeakDelegate((Action)c.MySimpleMethod, false); GC.Collect(); Assert.IsNotNull(w.Target); }
public void KeppAlive_With_Parameterized_Method() { var c = new MyWeakClass(); var w = new WeakDelegate((Action <string>)c.MyMethod, true); c = null; GC.Collect(); Assert.IsNotNull(w.Target); }
public void KeepAlive() { var c = new MyWeakClass(); var w = new WeakDelegate((Action)c.MySimpleMethod, true); c = null; GC.Collect(); Assert.IsNotNull(w.Target); }