public Append ( string predicate ) : |
||
predicate | string | The predicate to be appended. |
return |
public void ToStringReturnsInnerSql() { var rawWhereBuilder = new RawWhereBuilder(); rawWhereBuilder.Append("Forename = @p0", "Fred"); Assert.Equal("Forename = @p0", rawWhereBuilder.ToString()); }
public void ApplyToEnsuresParametersAreRenumberedAndAllArgumentsAreAppended() { var rawWhereBuilder = new RawWhereBuilder(); rawWhereBuilder.Append("ForeName = @p0 AND Surname = @p1", "Fred", "Flintstone") .Append(" AND Created > @p0", DateTime.Today) .Append(" AND LastLogin IS NOT NULL"); var mockSqlBuilder = new Mock<IWhereOrOrderBy>(); rawWhereBuilder.ApplyTo(mockSqlBuilder.Object); mockSqlBuilder.Verify( x => x.Where("ForeName = @p0 AND Surname = @p1 AND Created > @p2 AND LastLogin IS NOT NULL", "Fred", "Flintstone", DateTime.Today), Times.Once()); }