Browse Source

Update unit test

pull/20/head
sunkaixuan 2 years ago
parent
commit
105ad2c3ef
  1. 5
      Src/Asp.Net/SqlServerTest/UnitTest/UCustom012.cs
  2. 4
      Src/Asp.Net/SqlServerTest/UnitTest/UOneManyMany.cs
  3. 8
      Src/Asp.Net/SqlServerTest/UnitTest/UOneManyMany2.cs
  4. 8
      Src/Asp.Net/SqlServerTest/UnitTest/UOneManyMany3.cs
  5. 8
      Src/Asp.Net/SqlServerTest/UnitTest/UOneManyMany4.cs

5
Src/Asp.Net/SqlServerTest/UnitTest/UCustom012.cs

@ -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();
} }

4
Src/Asp.Net/SqlServerTest/UnitTest/UOneManyMany.cs

@ -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();

8
Src/Asp.Net/SqlServerTest/UnitTest/UOneManyMany2.cs

@ -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

8
Src/Asp.Net/SqlServerTest/UnitTest/UOneManyMany3.cs

@ -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

8
Src/Asp.Net/SqlServerTest/UnitTest/UOneManyMany4.cs

@ -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)

Loading…
Cancel
Save