From 82706ad443fe104a78e83240ca9f6e9513e7f6a4 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 13 Sep 2022 17:34:59 +0800 Subject: [PATCH] Add unit test --- Src/Asp.Net/SqlServerTest/UnitTest/UCustom24.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom24.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom24.cs index ce2b2c596..8e932781d 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom24.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom24.cs @@ -106,6 +106,22 @@ namespace OrmTest { throw new Exception("unit error"); } + var p = new Order() { }; + var sqlobj=db.Updateable().SetColumns(x => x.Name == p.Name) + .Where(x => x.Id == 1).ToSql(); + + if (!sqlobj.Key.Contains("=")) + { + throw new Exception("unit error"); + } + + var sqlobj2 = db.Updateable().SetColumns(x => x.Name == null) + .Where(x => x.Id == 1).ToSql(); + + if (!sqlobj2.Key.Contains("=")) + { + throw new Exception("unit error"); + } } public class TestDTO