Browse Source

Add unit test

pull/40/head
sunkaixuan 1 year ago
parent
commit
bf6282ad8d
  1. 6
      Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs

6
Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs

@ -14,11 +14,13 @@ namespace OrmTest
db.Queryable<EmpLicenseLogOff>()
.Where(it => it.EmpLicense.EmpInformation.EmpDepartmentJobs.Any())
.ToList();
db.Queryable<Order>()
.Where(b =>
$"{b.Name}^{b.Name}^{b.Name}^{b.Id}^{1} ".Contains("a")).ToList();
var sql = db.Queryable<Order>()
.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");
}

Loading…
Cancel
Save