public override void SetUp ()
    {
      base.SetUp ();

      _cookSource = new MainSourceExpressionNode ("s", Expression.Constant (new[] { new Cook () }));
      _cookClause = ExpressionHelper.CreateMainFromClause<Cook> ();
      ClauseGenerationContext.AddContextInfo (_cookSource, _cookClause);

      _ofTypeWithChefMethod = ReflectionUtility.GetMethod (() => ((IQueryable<Cook[]>) null).OfType<Chef> ());
      _node = new OfTypeExpressionNode (CreateParseInfo (_cookSource, "s", _ofTypeWithChefMethod));
    }
        private QueryModel WrapQueryModel(QueryModel queryModel, string associatedIdentifier, ClauseGenerationContext clauseGenerationContext)
        {
            var subQueryExpression = new SubQueryExpression(queryModel);

            // change the Source of this node so that Resolve will later correctly go to the new main from clause we create for the sub query
            var newMainSourceNode = new MainSourceExpressionNode(associatedIdentifier, subQueryExpression);

            Source = newMainSourceNode;

            return(newMainSourceNode.Apply(null, clauseGenerationContext));
        }
    public void SetUp ()
    {
      _methodInfoBasedNodeTypeRegistry = new MethodInfoBasedNodeTypeRegistry ();

      _methodInfoBasedNodeTypeRegistry.Register (WhereExpressionNode.GetSupportedMethods(), typeof (WhereExpressionNode));
      _methodInfoBasedNodeTypeRegistry.Register (SelectExpressionNode.GetSupportedMethods(), typeof (SelectExpressionNode));
      _methodInfoBasedNodeTypeRegistry.Register (TakeExpressionNode.GetSupportedMethods(), typeof (TakeExpressionNode));
      _methodInfoBasedNodeTypeRegistry.Register (CountExpressionNode.GetSupportedMethods(), typeof (CountExpressionNode));
      _methodInfoBasedNodeTypeRegistry.Register (JoinExpressionNode.GetSupportedMethods(), typeof (JoinExpressionNode));

      _parser = new MethodCallExpressionParser (_methodInfoBasedNodeTypeRegistry);

      _source = ExpressionNodeObjectMother.CreateMainSource();
    }
 public override void SetUp ()
 {
   base.SetUp ();
   _node = ExpressionNodeObjectMother.CreateMainSource ();
 }
 public void SetUp ()
 {
   _node = ExpressionNodeObjectMother.CreateMainSource ();
   _context = new ClauseGenerationContext (new MethodInfoBasedNodeTypeRegistry ());
   _clause = ExpressionHelper.CreateMainFromClause_Int ();
 }
    private QueryModel WrapQueryModel (QueryModel queryModel, string associatedIdentifier, ClauseGenerationContext clauseGenerationContext)
    {
      var subQueryExpression = new SubQueryExpression (queryModel);

      // change the Source of this node so that Resolve will later correctly go to the new main from clause we create for the sub query
      var newMainSourceNode = new MainSourceExpressionNode (associatedIdentifier, subQueryExpression);
      _source = newMainSourceNode;

      return newMainSourceNode.Apply (null, clauseGenerationContext);
    }