public void IsStatic_ReturnsFalse <TIn, TOut>( TIn inputParameter, TOut outputParameter) { var weakFunc = StaticWeakDelegatesCallCounter.GetWeakAnonymousFuncWithStaticReference <TIn, TOut>(); Assert.False(weakFunc.IsStatic); }
public void IsAlive_AfterGarbageCollection_ReturnsTrue <TOut>(TOut outputParameter) { var weakFunc = StaticWeakDelegatesCallCounter.GetWeakAnonymousFuncWithStaticReference <TOut>(); GC.Collect(); Assert.True(weakFunc.IsAlive); }
public void Execute_AfterGarbageCollection_InvokesFunc <TOut>(TOut outputParameter) { var callCounter = Substitute.For <ICallCounter>(); using (StaticWeakDelegatesCallCounter.WithCallCounter(callCounter)) { var weakFunc = StaticWeakDelegatesCallCounter.GetWeakAnonymousFuncWithStaticReference <TOut>(); GC.Collect(); weakFunc.Execute(); callCounter.Received(1).OnFuncCalled <TOut>(); } }