From 50f2a0a46ed8ff0ceef63a7dc0085d73346da9db Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 11 Jul 2023 12:48:48 +0800 Subject: [PATCH] Add unit test --- .../SqlSeverTest/UnitTest/UnitOneToOneNAny.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs b/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs index 3979d93aa..9c8da2a0f 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs @@ -13,7 +13,15 @@ namespace OrmTest db.CodeFirst.InitTables(); db.Queryable() .Where(it => it.EmpLicense.EmpInformation.EmpDepartmentJobs.Any()) - .ToList(); + .ToList(); + + var sql = db.Queryable() + .Where(b => + $"{b.Name}^{b.Name}^{b.Name}^{b.Id}^{1} ".Contains("a")).ToSqlString(); + if (!sql.Contains("'[Name]^[Name]^[Name]^[Id]^ 1 ' like")) + { + throw new Exception("unit error"); + } } } }