Exemplo n.º 1
0
        public void WhereParenthesis2()
        {
            WhereList w = new WhereList(global::SqlBuilder.Format.MsSQL);

            w.Equal("id");
            w.OpenParenthesis(2);
            w.IsNULL("a", "b", "c");
            w.CloseParenthesis();
            w.Or();
            w.OpenParenthesis();
            w.And();
            w.IsNULL("d", "e", "f");
            w.CloseParenthesis(2);
            string result = w.GetSql();
            string sql    = "[id]=@id AND (([a] IS NULL AND [b] IS NULL AND [c] IS NULL) OR ([d] IS NULL AND [e] IS NULL AND [f] IS NULL))";

            Assert.AreEqual(sql, result);
        }
Exemplo n.º 2
0
        public void IsNullSimple()
        {
            WhereList w = new WhereList(global::SqlBuilder.Format.MsSQL);

            w.IsNULL("a", "b", "c");
            string result = w.GetSql();
            string sql    = "[a] IS NULL AND [b] IS NULL AND [c] IS NULL";

            Assert.AreEqual(sql, result);
        }
Exemplo n.º 3
0
        public void WhereParenthesis2()
        {
            SuperSql.DefaultFormatter = FormatterLibrary.MsSql;

            var w = new WhereList(SuperSql.DefaultFormatter);

            w.Equal("id");
            w.OpenParenthesis(2);
            w.IsNULL("a", "b", "c");
            w.CloseParenthesis();
            w.Or();
            w.OpenParenthesis();
            w.And();
            w.IsNULL("d", "e", "f");
            w.CloseParenthesis(2);
            var result = w.GetSql();
            var sql    = "[id]=@id AND (([a] IS NULL AND [b] IS NULL AND [c] IS NULL) OR ([d] IS NULL AND [e] IS NULL AND [f] IS NULL))";

            Assert.Equal(sql, result);
        }
Exemplo n.º 4
0
        public void IsNullSimple()
        {
            SqlBuilder.DefaultFormatter = FormatterLibrary.MsSql;

            WhereList w = new WhereList(SqlBuilder.DefaultFormatter);

            w.IsNULL("a", "b", "c");
            string result = w.GetSql();
            string sql    = "[a] IS NULL AND [b] IS NULL AND [c] IS NULL";

            Assert.AreEqual(sql, result);
        }
Exemplo n.º 5
0
        public void IsNullSimple()
        {
            SuperSql.DefaultFormatter = FormatterLibrary.MsSql;

            var w = new WhereList(SuperSql.DefaultFormatter);

            w.IsNULL("a", "b", "c");
            var result = w.GetSql();
            var sql    = "[a] IS NULL AND [b] IS NULL AND [c] IS NULL";

            Assert.Equal(sql, result);
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
        public void WhereParenthesis1()
        {
            WhereList w = new WhereList(global::SqlBuilder.Format.MsSQL);

            w.OpenParenthesis();
            w.Or();
            w.IsNULL("a", "b", "c");
            w.CloseParenthesis();
            string result = w.GetSql();
            string sql    = "([a] IS NULL OR [b] IS NULL OR [c] IS NULL)";

            Assert.AreEqual(sql, result);
        }
Exemplo n.º 8
0
        public void WhereParenthesis1()
        {
            SqlBuilder.DefaultFormatter = FormatterLibrary.MsSql;

            WhereList w = new WhereList(SqlBuilder.DefaultFormatter);

            w.OpenParenthesis();
            w.Or();
            w.IsNULL("a", "b", "c");
            w.CloseParenthesis();
            string result = w.GetSql();
            string sql    = "([a] IS NULL OR [b] IS NULL OR [c] IS NULL)";

            Assert.AreEqual(sql, result);
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
0
        public void WhereParenthesis1()
        {
            SuperSql.DefaultFormatter = FormatterLibrary.MsSql;

            var w = new WhereList(SuperSql.DefaultFormatter);

            w.OpenParenthesis();
            w.Or();
            w.IsNULL("a", "b", "c");
            w.CloseParenthesis();
            var result = w.GetSql();
            var sql    = "([a] IS NULL OR [b] IS NULL OR [c] IS NULL)";

            Assert.Equal(sql, result);
        }