public void GetResolvedSelector() { var selector = ExpressionHelper.CreateLambdaExpression <int, bool> (i => i > 5); var node = new OrderByExpressionNode(CreateParseInfo(), selector); var expectedResult = Expression.MakeBinary(ExpressionType.GreaterThan, SourceReference, Expression.Constant(5)); var result = node.GetResolvedKeySelector(ClauseGenerationContext); ExpressionTreeComparer.CheckAreEqualTrees(expectedResult, result); }
public void Apply() { var result = _node.Apply(QueryModel, ClauseGenerationContext); Assert.That(result, Is.SameAs(QueryModel)); Assert.That(QueryModel.BodyClauses.Count, Is.EqualTo(1)); var clause = ((OrderByClause)QueryModel.BodyClauses[0]); Assert.That(clause.Orderings.Count, Is.EqualTo(1)); Assert.That(clause.Orderings[0].OrderingDirection, Is.EqualTo(OrderingDirection.Asc)); Assert.That(clause.Orderings[0].Expression, Is.SameAs(_node.GetResolvedKeySelector(ClauseGenerationContext))); }