public void ShouldBeTriggeredWithoutClosure_Right()
        {
            var hint = new DelegateShouldHaveBeenInvokedEqualsHint();

            Func <int> f = () => 3;

            Expression <Func <bool> > ex = () => Equals(3, f);
            var p = new ExpressionParser(ex.Body);

            string ignored;

            Assert.IsTrue(hint.TryGetHint(p, ex.Body, out ignored));
            Assert.IsNotNull(ignored);
        }
        public void ShouldNotBeTriggeredIfBothAreDelegates()
        {
            var hint = new DelegateShouldHaveBeenInvokedEqualsHint();

            Func <int> f = () => 3;

            Expression <Func <bool> > ex = () => Equals(f, f);
            var p = new ExpressionParser(ex.Body);

            string ignored;

            Assert.IsTrue(hint.TryGetHint(p, ex.Body, out ignored));

            Assert.IsTrue(ignored.Contains("suspicious"));
        }
        public void ShouldBeTriggeredWithClosure_Left()
        {
            var hint = new DelegateShouldHaveBeenInvokedEqualsHint();

            int        n = 3;
            Func <int> f = () => n; // now this func requires a closure

            Expression <Func <bool> > ex = () => Equals(f, 3);
            var p = new ExpressionParser(ex.Body);

            string ignored;

            Assert.IsTrue(hint.TryGetHint(p, ex.Body, out ignored));
            Assert.IsNotNull(ignored);
        }