public void VisitSqlSubStatementExpression_LeavesSqlSubStatementExpression_ForStreamedScalarInfo() { var sqlStatement = SqlStatementModelObjectMother.CreateSqlStatement_Scalar(); var expression = new SqlSubStatementExpression(sqlStatement); _stageMock .Expect(mock => mock.ResolveSqlStatement(sqlStatement, _mappingResolutionContext)) .Return(sqlStatement); _groupAggregateSimplifier .Expect(mock => mock.SimplifyIfPossible(expression, sqlStatement.SelectProjection)) .Return(expression); var visitor = CreateVisitor(new SqlStatementBuilder(sqlStatement)); var result = visitor.VisitExpression(expression); _stageMock.VerifyAllExpectations(); _groupAggregateSimplifier.VerifyAllExpectations(); Assert.That(result, Is.TypeOf(typeof(SqlSubStatementExpression))); Assert.That(((SqlSubStatementExpression)result).SqlStatement, Is.SameAs(sqlStatement)); }