Browse Source

Update unit test

pull/40/head
sunkaixuan 1 year ago
parent
commit
763b89de45
  1. 16
      Src/Asp.NetCore2/SqlSeverTest/UnitTest/Unitadfasdfa.cs

16
Src/Asp.NetCore2/SqlSeverTest/UnitTest/Unitadfasdfa.cs

@ -88,6 +88,22 @@ namespace OrmTest
{
throw new Exception("unit error");
}
var sq2 = db.QueryableWithAttr<KingJsonTest>()
.LeftJoin<KingTree>((t, j) => t.Id == j.Id)
.Where((t, j) => t.CreateTime == null || j.ParentId == 1)
.Select((t, j) => new KingOutPut() { }, true)
.ToSqlString();
var sql3 = "SELECT \"T\".\"CREATE_TIME\" AS \"CREATETIME\" ,\"J\".\"PARENTID\" AS \"PARENTID\" FROM \"KING_JSON_TEST\" \"T\" Left JOIN HGT.\"KINGTREE\" \"J\" ON ( \"T\".\"ID\" = \"J\".\"ID\" ) WHERE (( \"T\".\"CREATE_TIME\" IS NULL ) OR ( \"J\".\"PARENTID\" = 1 ))";
if (sq2 != sql3)
{
throw new Exception("unit error");
}
}
public class KingOutPut
{
public DateTime CreateTime { get; set; }
public int ParentId { get; set; }
}
//Json字段实体

Loading…
Cancel
Save