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

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

            GC.Collect();

            Assert.True(weakAction.IsAlive);
        }
示例#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);
            }
        }