Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
        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);
        }