Example #1
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);
        }