Browse Source

Add unit test

SqlSugar5
sunkaixuan 2 years ago
parent
commit
20741778d2
  1. 15
      Src/Asp.Net/SqlServerTest/UnitTest/UnitSelectN.cs

15
Src/Asp.Net/SqlServerTest/UnitTest/UnitSelectN.cs

@ -43,6 +43,21 @@ namespace OrmTest
{
throw new Exception("unit error");
}
var data3 = db.Queryable<B>()
.LeftJoin<A>((b, a) => b.AId == a.AId)
.LeftJoin<AA>((b, a, aa) => a.AId == aa.AId)
.LeftJoin<BB>((b, a, aa, bb) => bb.BId == b.BId)
.Select((b, a, aa, bb) => new
{
b=b.BId,
A=new ADTO() { AId=a.AId },
B = new BDTO{ BId = b.BId, BName = b.BName, AId = a.AId }
})
.ToList();
if (data3.First().B.BId != 1 && data3.First().B.BName != "a"&& data3.First().b!=1)
{
throw new Exception("unit error");
}
}
[SqlSugar.SugarTable("unita1")]

Loading…
Cancel
Save