public BuildWherePart ( |
||
sqlStatement | ||
commandBuilder | ISqlCommandBuilder | |
return | void |
public void BuildWhere_WithSingleWhereCondition() { var sqlStatement = SqlStatementModelObjectMother.CreateMinimalSqlStatement(new SqlStatementBuilder { WhereCondition = Expression.Constant(true) }); _stageMock.Expect(mock => mock.GenerateTextForWhereExpression(_commandBuilder, sqlStatement.WhereCondition)) .WhenCalled(mi => ((SqlCommandBuilder)mi.Arguments[0]).Append("(@1 = 1)")); _stageMock.Replay(); _generator.BuildWherePart(sqlStatement, _commandBuilder); Assert.That(_commandBuilder.GetCommandText(), Is.EqualTo(" WHERE (@1 = 1)")); _stageMock.VerifyAllExpectations(); }
public void BuildWhere_WithSingleWhereCondition() { var sqlStatement = new SqlStatementBuilder { DataInfo = new TestStreamedValueInfo(typeof(int)), SelectProjection = _entityExpression, WhereCondition = Expression.Constant(true) } .GetSqlStatement(); _stageMock.Expect(mock => mock.GenerateTextForWhereExpression(_commandBuilder, sqlStatement.WhereCondition)) .WhenCalled(mi => ((SqlCommandBuilder)mi.Arguments[0]).Append("(@1 = 1)")); _stageMock.Replay(); _generator.BuildWherePart(sqlStatement, _commandBuilder); Assert.That(_commandBuilder.GetCommandText(), Is.EqualTo(" WHERE (@1 = 1)")); _stageMock.VerifyAllExpectations(); }