public void Apply() { var result = _node.Apply(QueryModel, ClauseGenerationContext); Assert.That(result, Is.SameAs(QueryModel)); var selectClause = QueryModel.SelectClause; Assert.That(selectClause.Selector, Is.EqualTo(_node.GetResolvedSelector(ClauseGenerationContext))); }
public void GetResolvedSelector() { var selector = ExpressionHelper.CreateLambdaExpression <int, bool> (i => i > 5); var node = new SelectExpressionNode(CreateParseInfo(), selector); var expectedResult = Expression.MakeBinary(ExpressionType.GreaterThan, SourceReference, Expression.Constant(5)); var result = node.GetResolvedSelector(ClauseGenerationContext); ExpressionTreeComparer.CheckAreEqualTrees(expectedResult, result); }