Example #1
0
        public void Test_Razor_Nulls()
        {
            var runner = new Runner();
            var model  = Runnable.Query <Blog>();

            var result1 = runner.Sql <Blog>(p => p.ColName(m => m.Id).IsNull());
            var result2 = runner.Sql <Blog>(p => p.ColName(m => m.Id).IsNotNull());

            result1.ShouldBe(@"""Id"" IS NULL");
            result2.ShouldBe(@"""Id"" IS NOT NULL");
        }
Example #2
0
        public void Test_Razor_IsEq()
        {
            var runner = new Runner();
            var model  = Runnable.Query <Blog>();

            model.R(m => m.ColNames().IsEq().ColNames());

            var result = Regex.Replace(runner.Sql(model), @"\s+", "");

            result.ShouldBe(@"""Id""=""Id""AND""Title""=""Title""AND""CategoryId""=""CategoryId""");
        }