public void IsStatic_ReturnsFalse()
        {
            var weakAction = StaticWeakDelegatesCallCounter
                             .GetWeakAnonymousActionWithStaticReference();

            Assert.False(weakAction.IsStatic);
        }
Esempio n. 2
0
        public void IsAlive_AfterGarbageCollection_ReturnsTrue <TIn>(TIn inputParameter)
        {
            var weakAction = StaticWeakDelegatesCallCounter.GetWeakAnonymousActionWithStaticReference <TIn>();

            GC.Collect();

            Assert.True(weakAction.IsAlive);
        }
Esempio n. 3
0
        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);
            }
        }