public void CanWriteFormattedText() { string expected = "<ul>\n\t<li>\n\t\t1 + 2 = 3\n\t</li>\n</ul>"; var writer = new SqlWriter(); writer.AppendLine("<ul>"); writer.Indent(); writer.AppendLine("<li>"); writer.Indent(); writer.AppendLine("1", "+", "2", "=", "3"); writer.Unindent(); writer.AppendLine("</li>"); writer.Unindent(); writer.AppendLine("</ul>"); var result = writer.GetResult(); Assert.AreEqual(expected, result); }
public void Render(SqlWriter writer) { writer.AppendLine(SqlStrings.Select); writer.Indent(); writer.AppendLine(Top); writer.AppendLine("*"); writer.Unindent(); writer.AppendLine(SqlStrings.From, "("); writer.Indent(); writer.AppendLine(_innerSelect); writer.Unindent(); writer.AppendLine(")", SqlStrings.As, _alias); writer.AppendLine(SqlStrings.Where, (BracketedName)SqlStrings.ROW_NUMBER, ">", _skip.ParamName); }
public void Render(SqlWriter writer) { writer.AppendLine(SqlStrings.Select); writer.Indent(); writer.AppendLine(Top); writer.AppendLine(Columns); writer.Unindent(); writer.AppendLine(From); writer.AppendLine(JoinGroup); writer.AppendLine(Where); writer.AppendLine(OrderBy); }
public void Render(SqlWriter writer) { writer.Append(Join, ReferenceMap.To.Table, SqlStrings.As, ToAlias, SqlStrings.NoLock); writer.Indent(); writer.AppendLine(SqlStrings.On, FromAlias + ReferenceMap.Column, "=", ToAlias + ReferenceMap.To.Key.Column); writer.Unindent(); }