Add user test case

This commit is contained in:
sunkaixuan 2024-06-17 21:54:08 +08:00
parent f11bd92185
commit 1be19a1a4d

View File

@ -50,6 +50,21 @@ namespace OrmTest
.Includes(it => it.Roles) .Includes(it => it.Roles)
.ToList(); .ToList();
var list2 = db.Queryable<OperatorInfo>()
.Includes(it => it.Roles.Select(it => new Role() {
name = it.name,
}).ToList())
.Select(it => new {
id=it.id,
roles = it.Roles.Select(it => new { name = it.name }).ToList()
})
.ToList();
if (list2.First().roles.Count == 0)
{
throw new Exception("unit error");
}
TestLength2(db); TestLength2(db);
TestLength3(db); TestLength3(db);
TestLength1(db); TestLength1(db);