public void RawSimple1() { WhereList w = new WhereList(global::SqlBuilder.Format.MsSQL); w.Raw("[a] IS NULL AND [b]=2 AND [c] NOT LIKE '%text%'"); string result = w.GetSql(); string sql = "[a] IS NULL AND [b]=2 AND [c] NOT LIKE '%text%'"; Assert.AreEqual(sql, result); }
public void RawSimple2() { WhereList w = new WhereList(global::SqlBuilder.Format.MsSQL); w.Raw("[a] NOT LIKE '%text%'"); w.Equal("id"); string result = w.GetSql(); string sql = "[a] NOT LIKE '%text%' AND [id]=@id"; Assert.AreEqual(sql, result); }
public void RawSimple1() { SqlBuilder.DefaultFormatter = FormatterLibrary.MsSql; WhereList w = new WhereList(SqlBuilder.DefaultFormatter); w.Raw("[a] IS NULL AND [b]=2 AND [c] NOT LIKE '%text%'"); string result = w.GetSql(); string sql = "[a] IS NULL AND [b]=2 AND [c] NOT LIKE '%text%'"; Assert.AreEqual(sql, result); }
public void RawSimple1() { SuperSql.DefaultFormatter = FormatterLibrary.MsSql; var w = new WhereList(SuperSql.DefaultFormatter); w.Raw("[a] IS NULL AND [b]=2 AND [c] NOT LIKE '%text%'"); var result = w.GetSql(); var sql = "[a] IS NULL AND [b]=2 AND [c] NOT LIKE '%text%'"; Assert.Equal(sql, result); }
public void RawSimple2() { SqlBuilder.DefaultFormatter = FormatterLibrary.MsSql; WhereList w = new WhereList(SqlBuilder.DefaultFormatter); w.Raw("[a] NOT LIKE '%text%'"); w.Equal("id"); string result = w.GetSql(); string sql = "[a] NOT LIKE '%text%' AND [id]=@id"; Assert.AreEqual(sql, result); }
public void RawSimple2() { SuperSql.DefaultFormatter = FormatterLibrary.MsSql; var w = new WhereList(SuperSql.DefaultFormatter); w.Raw("[a] NOT LIKE '%text%'"); w.Equal("id"); var result = w.GetSql(); var sql = "[a] NOT LIKE '%text%' AND [id]=@id"; Assert.Equal(sql, result); }
public void WhereTableAlias1() { SqlBuilder.DefaultFormatter = FormatterLibrary.MsSql; WhereList w = new WhereList(SqlBuilder.DefaultFormatter); w.Raw("[a] IS NULL"); w.SetTableAlias("ttt"); w.Equal("id"); w.SetTableAlias("ddd"); w.Equal("age"); w.SetTableAlias(); w.Equal("old_value"); string result = w.GetSql("old"); string sql = "[a] IS NULL AND [ttt].[id]=@id AND [ddd].[age]=@age AND [old].[old_value]=@old_value"; Assert.AreEqual(sql, result); }