Update unit test

This commit is contained in:
sunkaixuan 2022-07-04 05:00:47 +08:00
parent ee11466d12
commit 105ad2c3ef
5 changed files with 16 additions and 17 deletions

View File

@ -206,10 +206,9 @@ namespace OrmTest
//开发中 //开发中
db.InsertNav(list6) db.InsertNav(list6)
.ThenInclude(z1 => z1.SchoolA) .Include(z1 => z1.SchoolA)
.ThenInclude(z1 => z1.RoomList) .ThenInclude(z1 => z1.RoomList)
.AsNav() .Include(z1 => z1.Books).ExecuteCommand();
.ThenInclude(z1 => z1.Books).ExecuteCommand();
} }

View File

@ -78,11 +78,11 @@ namespace OrmTest
} }
db.DbMaintenance.TruncateTable<Student_001, School_001, Room_001, Desk_001>(); db.DbMaintenance.TruncateTable<Student_001, School_001, Room_001, Desk_001>();
db.InsertNav(list.First()) db.InsertNav(list.First())
.ThenInclude(x => x.school_001) .Include(x => x.school_001)
.ThenInclude(x => x.rooms) .ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last()) db.InsertNav(list.Last())
.ThenInclude(x => x.school_001) .Include(x => x.school_001)
.ThenInclude(x => x.rooms) .ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();

View File

@ -94,11 +94,11 @@ namespace OrmTest
} }
} }
db.InsertNav(list.First()) db.InsertNav(list.First())
.ThenInclude(x => x.school_001) .Include(x => x.school_001)
.ThenInclude(x => x.rooms) .ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last()) db.InsertNav(list.Last())
.ThenInclude(x => x.school_001) .Include(x => x.school_001)
.ThenInclude(x => x.rooms) .ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
@ -111,10 +111,10 @@ namespace OrmTest
db.DbMaintenance.TruncateTable<Student_002, School_002, Room_002, Desk_002>(); db.DbMaintenance.TruncateTable<Student_002, School_002, Room_002, Desk_002>();
db.InsertNav(list.First().school_001) db.InsertNav(list.First().school_001)
.ThenInclude(x => x.rooms) .Include(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last().school_001) db.InsertNav(list.Last().school_001)
.ThenInclude(x => x.rooms) .Include(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
if (db.Queryable<Desk_002>().Count() != 4 || db.Queryable<Room_002>().Count() != 4 if (db.Queryable<Desk_002>().Count() != 4 || db.Queryable<Room_002>().Count() != 4

View File

@ -94,11 +94,11 @@ namespace OrmTest
} }
} }
db.InsertNav(list.First()) db.InsertNav(list.First())
.ThenInclude(x => x.school_001) .Include(x => x.school_001)
.ThenInclude(x => x.rooms) .ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last()) db.InsertNav(list.Last())
.ThenInclude(x => x.school_001) .Include(x => x.school_001)
.ThenInclude(x => x.rooms) .ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
@ -111,10 +111,10 @@ namespace OrmTest
db.DbMaintenance.TruncateTable<Student_003, School_003, Room_003, Desk_003>(); db.DbMaintenance.TruncateTable<Student_003, School_003, Room_003, Desk_003>();
db.InsertNav(list.First().school_001) db.InsertNav(list.First().school_001)
.ThenInclude(x => x.rooms) .Include(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last().school_001) db.InsertNav(list.Last().school_001)
.ThenInclude(x => x.rooms) .Include(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
if (db.Queryable<Desk_003>().Count() != 4 || db.Queryable<Room_003>().Count() != 4 if (db.Queryable<Desk_003>().Count() != 4 || db.Queryable<Room_003>().Count() != 4

View File

@ -99,11 +99,11 @@ namespace OrmTest
} }
} }
db.InsertNav(list.First()) db.InsertNav(list.First())
.ThenInclude(x => x.school_001) .Include(x => x.school_001)
.ThenInclude(x => x.rooms) .ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last()) db.InsertNav(list.Last())
.ThenInclude(x => x.school_001) .Include(x => x.school_001)
.ThenInclude(x => x.rooms) .ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
@ -116,10 +116,10 @@ namespace OrmTest
db.DbMaintenance.TruncateTable<Student_004, School_004, Room_004, Desk_004>(); db.DbMaintenance.TruncateTable<Student_004, School_004, Room_004, Desk_004>();
db.InsertNav(list.First().school_001) db.InsertNav(list.First().school_001)
.ThenInclude(x => x.rooms) .Include(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last().school_001) db.InsertNav(list.Last().school_001)
.ThenInclude(x => x.rooms) .Include(x => x.rooms)
.ThenInclude(x => x.desk).ExecuteCommand(); .ThenInclude(x => x.desk).ExecuteCommand();
if (db.Queryable<Desk_004>().Count() != 4 || db.Queryable<Room_004>().Count() != 4 if (db.Queryable<Desk_004>().Count() != 4 || db.Queryable<Room_004>().Count() != 4
|| db.Queryable<School_004>().Count() != 2 || db.Queryable<Student_004>().Count() != 0) || db.Queryable<School_004>().Count() != 2 || db.Queryable<Student_004>().Count() != 0)