public void AndLess() { WhereList w = new WhereList(global::SqlBuilder.Format.MsSQL); w.Less("a", "b", "c"); string result = w.GetSql(); string sql = "[a]<@a AND [b]<@b AND [c]<@c"; Assert.AreEqual(sql, result); }
public void ComboAndGreaterAndLess() { WhereList w = new WhereList(global::SqlBuilder.Format.MsSQL); w.Greater("a"); w.Less("b"); string result = w.GetSql(); string sql = "[a]>@a AND [b]<@b"; Assert.AreEqual(sql, result); }
public void AndLess() { SqlBuilder.DefaultFormatter = FormatterLibrary.MsSql; WhereList w = new WhereList(SqlBuilder.DefaultFormatter); w.Less("a", "b", "c"); string result = w.GetSql(); string sql = "[a]<@a AND [b]<@b AND [c]<@c"; Assert.AreEqual(sql, result); }
public void AndLess() { SuperSql.DefaultFormatter = FormatterLibrary.MsSql; var w = new WhereList(SuperSql.DefaultFormatter); w.Less("a", "b", "c"); var result = w.GetSql(); var sql = "[a]<@a AND [b]<@b AND [c]<@c"; Assert.Equal(sql, result); }
public void ComboAndGreaterAndLess() { SqlBuilder.DefaultFormatter = FormatterLibrary.MsSql; WhereList w = new WhereList(SqlBuilder.DefaultFormatter); w.Greater("a"); w.Less("b"); string result = w.GetSql(); string sql = "[a]>@a AND [b]<@b"; Assert.AreEqual(sql, result); }
public void ComboAndGreaterAndLess() { SuperSql.DefaultFormatter = FormatterLibrary.MsSql; var w = new WhereList(SuperSql.DefaultFormatter); w.Greater("a"); w.Less("b"); var result = w.GetSql(); var sql = "[a]>@a AND [b]<@b"; Assert.Equal(sql, result); }
public void WhereParenthesis3() { WhereList w = new WhereList(global::SqlBuilder.Format.MsSQL); w.OpenParenthesis(3); w.Or(); w.IsNULL("a", "b"); w.CloseParenthesis(); w.And(); w.OpenParenthesis(); w.Or(); w.IsNULL("c", "d"); w.CloseParenthesis(2); w.And(); w.Less("ls"); w.CloseParenthesis(); w.Greater("gr"); string result = w.GetSql(); string sql = "((([a] IS NULL OR [b] IS NULL) AND ([c] IS NULL OR [d] IS NULL)) AND [ls]<@ls) AND [gr]>@gr"; Assert.AreEqual(sql, result); }
public void WhereParenthesis3() { SuperSql.DefaultFormatter = FormatterLibrary.MsSql; var w = new WhereList(SuperSql.DefaultFormatter); w.OpenParenthesis(3); w.Or(); w.IsNULL("a", "b"); w.CloseParenthesis(); w.And(); w.OpenParenthesis(); w.Or(); w.IsNULL("c", "d"); w.CloseParenthesis(2); w.And(); w.Less("ls"); w.CloseParenthesis(); w.Greater("gr"); var result = w.GetSql(); var sql = "((([a] IS NULL OR [b] IS NULL) AND ([c] IS NULL OR [d] IS NULL)) AND [ls]<@ls) AND [gr]>@gr"; Assert.Equal(sql, result); }