public void RenderTableFromClause() { Table table = new Table("Table1"); TableFromClause tableFromClause = new TableFromClause(table); Assert.AreEqual("[Table1]", sqlClientRenderer.Render(tableFromClause)); }
public void RenderTableFromClauseWithAlias() { Table table = new Table("Table1"); TableFromClause tableFromClause = new TableFromClause(table, "Table1Alias"); Assert.AreEqual("[Table1] Table1Alias", sqlClientRenderer.Render(tableFromClause)); }
public void CreateTableFromClauseWithAlias() { Table table = new Table("Table1"); TableFromClause tableFromClause = new TableFromClause(table, "Table1Alias"); Assert.AreEqual(table, tableFromClause.Table); Assert.AreEqual("Table1Alias", tableFromClause.Alias); }
public void CreateTableFromClause() { Table table = new Table("Table1"); TableFromClause tableFromClause = new TableFromClause(table); Assert.AreEqual(table, tableFromClause.Table); Assert.IsNull(tableFromClause.Alias); }
public void RenderFromClauses() { Table table1 = new Table("Table1"); Table table2 = new Table("Table2"); TableFromClause fromClause1 = new TableFromClause(table1); TableFromClause fromClause2 = new TableFromClause(table2); FromClauses fromClauses = new FromClauses(fromClause1, fromClause2); Assert.AreEqual("[Table1], [Table2]", sqlClientRenderer.Render(fromClauses)); }
public void AddTableFromClauseToSelectQuery() { SelectQuery selectQuery = new SelectQuery(); Table table = new Table("Table1"); TableFromClause tableFromClause = new TableFromClause(table); selectQuery.From(tableFromClause); Assert.AreEqual(tableFromClause, selectQuery.FromClause); }
public void CreateFromClauses() { Table table1 = new Table("Table1"); Table table2 = new Table("Table2"); TableFromClause fromClause1 = new TableFromClause(table1); TableFromClause fromClause2 = new TableFromClause(table2); FromClauses fromClauses = new FromClauses(fromClause1, fromClause2); Assert.AreEqual(fromClause1, fromClauses.LeftClause); Assert.AreEqual(fromClause2, fromClauses.RightClause); }
public override string Render(TableFromClause tableFromClause) { StringBuilder text = new StringBuilder(); text.AppendFormat("{0} ", tableFromClause.Table.Render(this)); if (tableFromClause.Alias != null) { text.AppendFormat("{0} ", tableFromClause.Alias); } return(text.ToString().Trim()); }
public void AddFromClausesToSelectQuery() { SelectQuery selectQuery = new SelectQuery(); Table table1 = new Table("Table1"); Table table2 = new Table("Table2"); TableFromClause fromClause1 = new TableFromClause(table1); TableFromClause fromClause2 = new TableFromClause(table2); selectQuery.From(fromClause1); selectQuery.From(fromClause2); Assert.IsTrue(selectQuery.FromClause is FromClauses); }
public abstract string Render(TableFromClause tableFromClause);
public static JoinFromClause Join(TableFromClause leftTable, TableFromClause rightTable, ComparisonPredicate predicate) { return new JoinFromClause(leftTable, rightTable, predicate); }