mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Add unit test
This commit is contained in:
parent
1961b45025
commit
87c4bf46c5
@ -88,6 +88,25 @@ namespace OrmTest
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
var list = db.Queryable<Order>().ToList();
|
||||
var test7 = db.Queryable<Order>()
|
||||
.LeftJoin<Order>((x,y)=>x.Id==y.Id)
|
||||
.Take(2)
|
||||
.Select((x,y) => new TestDTO
|
||||
{
|
||||
SubOne = new TestSubDTO { NameOne = x.Name, NameTwo = x.Name },
|
||||
SubTwo = new TestSubDTO { NameOne = x.Name, NameTwo = x.Name }
|
||||
})
|
||||
.ToList() ;
|
||||
|
||||
if (test7.First().SubTwo.NameTwo != "jack"|| test7.First().SubTwo.NameOne != "jack")
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
if (test7.First().SubOne.NameTwo != "jack" || test7.First().SubOne.NameOne != "jack")
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
}
|
||||
|
||||
public class TestDTO
|
||||
|
Loading…
Reference in New Issue
Block a user