public void IsStatic_ReturnsFalse() { var weakAction = StaticWeakDelegatesCallCounter .GetWeakAnonymousActionWithStaticReference(); Assert.False(weakAction.IsStatic); }
public void IsAlive_AfterGarbageCollection_ReturnsTrue <TIn>(TIn inputParameter) { var weakAction = StaticWeakDelegatesCallCounter.GetWeakAnonymousActionWithStaticReference <TIn>(); GC.Collect(); Assert.True(weakAction.IsAlive); }
public void Execute_AfterGarbageCollection_InvokesAction <TIn>(TIn inputParameter) { var callCounter = Substitute.For <ICallCounter>(); using (StaticWeakDelegatesCallCounter.WithCallCounter(callCounter)) { var weakAction = StaticWeakDelegatesCallCounter.GetWeakAnonymousActionWithStaticReference <TIn>(); GC.Collect(); weakAction.Execute(inputParameter); callCounter.Received(1).OnActionCalled(inputParameter); } }