Beispiel #1
0
        public void ShouldCompileExpression()
        {
            Expression <Func <int, int> > expression = i => i + i;

            var subject = CachedExpression.From(expression);

            Assert.Equal(2, subject.Compiled(1));
        }
Beispiel #2
0
        public void ShouldCastToLambdaExpression()
        {
            Expression <Func <int, int> > expected = i => i + i;

            var subject = CachedExpression.From(expected);

            var actual = (LambdaExpression)subject;

            Assert.Equal(expected, actual);
        }