Provides a default implementation of ISqlPreparationStage.
Наследование: ISqlPreparationStage
    public void SetUp ()
    {
      _context = SqlStatementModelObjectMother.CreateSqlPreparationContext();

      var querySource = ExpressionHelper.CreateMainFromClause<Cook>();
      _sqlTable = new SqlTable (new UnresolvedTableInfo (typeof (Cook)), JoinSemantics.Inner);

      _context.AddExpressionMapping (new QuerySourceReferenceExpression(querySource), new SqlTableReferenceExpression(_sqlTable));

      _querySourceReferenceExpression = new QuerySourceReferenceExpression (querySource);

      _stage = new DefaultSqlPreparationStage (
          CompoundMethodCallTransformerProvider.CreateDefault(), ResultOperatorHandlerRegistry.CreateDefault(), new UniqueIdentifierGenerator());
    }
    public void SetUp ()
    {
      _generator = new UniqueIdentifierGenerator();
      _context = SqlStatementModelObjectMother.CreateSqlPreparationContext();
      _defaultStage = new DefaultSqlPreparationStage (
          CompoundMethodCallTransformerProvider.CreateDefault(), ResultOperatorHandlerRegistry.CreateDefault(), _generator);

      _mainFromClause = ExpressionHelper.CreateMainFromClause<Cook>();
      _selectClause = ExpressionHelper.CreateSelectClause (_mainFromClause);
      _orderByClause = ExpressionHelper.CreateOrderByClause();
      _queryModel = new QueryModel (_mainFromClause, _selectClause);

      _stageMock = MockRepository.GenerateStrictMock<ISqlPreparationStage>();
      _visitor = new TestableSqlPreparationQueryModelVisitor (_context, _stageMock);
      _visitorPartialMock = MockRepository.GeneratePartialMock<TestableSqlPreparationQueryModelVisitor> (_context, _stageMock);
    }
    public void VisitSqlSubStatementExpression_WithOrderingsAndNoTopExpression ()
    {
      var builder = new SqlStatementBuilder (SqlStatementModelObjectMother.CreateSqlStatementWithCook())
                    {
                        SelectProjection = new NamedExpression ("test", Expression.Constant ("test")),
                        Orderings = { new Ordering (Expression.Constant ("order1"), OrderingDirection.Asc) }
                    };
      var statement = builder.GetSqlStatement();
      var sqlSubStatementExpression = new SqlSubStatementExpression (statement);

      var stage = new DefaultSqlPreparationStage (_methodCallTransformerProvider, new ResultOperatorHandlerRegistry(), _generator);

      var result = SqlPreparationFromExpressionVisitor.AnalyzeFromExpression (
          sqlSubStatementExpression,
          stage,
          _generator,
          _methodCallTransformerProvider,
          _context,
          info => new SqlTable (info, JoinSemantics.Inner));

      var sqlTable = (SqlTable) result.SqlTable;
      Assert.That (sqlTable.TableInfo, Is.TypeOf (typeof (ResolvedSubStatementTableInfo)));
      Assert.That (((ResolvedSubStatementTableInfo) sqlTable.TableInfo).SqlStatement.Orderings.Count, Is.EqualTo (0));
    }
    public void VisitSqlSubStatementExpression_WithNonBooleanSqlGroupingSelectExpression ()
    {
      var sqlStatement = new SqlStatementBuilder (SqlStatementModelObjectMother.CreateSqlStatementWithCook())
                         {
                             SelectProjection =
                                 new NamedExpression (
                                     "test", new SqlGroupingSelectExpression (Expression.Constant ("key"), Expression.Constant ("element")))
                         }.GetSqlStatement();

      var sqlSubStatementExpression = new SqlSubStatementExpression (sqlStatement);
      var stage = new DefaultSqlPreparationStage (_methodCallTransformerProvider, new ResultOperatorHandlerRegistry(), _generator);

      var result = SqlPreparationFromExpressionVisitor.AnalyzeFromExpression (
          sqlSubStatementExpression,
          stage,
          _generator,
          _methodCallTransformerProvider,
          _context,
          info => new SqlTable (info, JoinSemantics.Inner));

      Assert.That (((SqlTable) result.SqlTable).TableInfo, Is.InstanceOf (typeof (ResolvedSubStatementTableInfo)));
    }