From bf6282ad8d2c475db13ebf107cd10dcfe2339dc4 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 11 Jul 2023 13:01:36 +0800 Subject: [PATCH] Add unit test --- Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs b/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs index 9c8da2a0f..17bb1ed7c 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs @@ -14,11 +14,13 @@ namespace OrmTest db.Queryable() .Where(it => it.EmpLicense.EmpInformation.EmpDepartmentJobs.Any()) .ToList(); - + db.Queryable() + .Where(b => + $"{b.Name}^{b.Name}^{b.Name}^{b.Id}^{1} ".Contains("a")).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")) + if (!sql.Contains("(''+ CAST('[Name]' AS NVARCHAR(MAX))+'^'+ CAST('[Name]' AS NVARCHAR(MAX))+'^'+ CAST('[Name]' AS NVARCHAR(MAX))+'^'+ CAST('[Id]' AS NVARCHAR(MAX))+'^'+ CAST(' 1 ' AS NVARCHAR(MAX))+'' like")) { throw new Exception("unit error"); }