Example #1
0
        public void TransformExpressions()
        {
            var oldExpression = _joinClause.OuterKeySelector;
            var newExpression = ExpressionHelper.CreateExpression();
            Func <Expression, Expression> transformation = ex => (ex == oldExpression ? newExpression : ex);

            _groupJoinClause.TransformExpressions(transformation);

            Assert.That(_joinClause.OuterKeySelector, Is.SameAs(newExpression));
        }
Example #2
0
        public void TransformExpressions()
        {
            var joinClauseMock = MockRepository.GenerateMock <JoinClause> (
                "x",
                typeof(Cook),
                ExpressionHelper.CreateExpression(),
                ExpressionHelper.CreateExpression(),
                ExpressionHelper.CreateExpression());

            _groupJoinClause.JoinClause = joinClauseMock;

            Func <Expression, Expression> transformation = ex => ex;

            _groupJoinClause.TransformExpressions(transformation);

            joinClauseMock.AssertWasCalled(mock => mock.TransformExpressions(transformation));
        }