Browse Source

Update unit test

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

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

@ -80,11 +80,11 @@ namespace OrmTest
db.InsertNav(list.First())
.ThenInclude(x => x.school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last())
.ThenInclude(x => x.school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
if (db.Queryable<Desk_001>().Count() != 4 || db.Queryable<Room_001>().Count() != 4
|| db.Queryable<School_001>().Count() != 2 || db.Queryable<Student_001>().Count() != 2)

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

@ -96,11 +96,11 @@ namespace OrmTest
db.InsertNav(list.First())
.ThenInclude(x => x.school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last())
.ThenInclude(x => x.school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
if (db.Queryable<Desk_002>().Count() != 4 || db.Queryable<Room_002>().Count() != 4
|| db.Queryable<School_002>().Count() != 2 || db.Queryable<Student_002>().Count() != 2)
@ -112,10 +112,10 @@ namespace OrmTest
db.InsertNav(list.First().school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last().school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
if (db.Queryable<Desk_002>().Count() != 4 || db.Queryable<Room_002>().Count() != 4
|| db.Queryable<School_002>().Count() != 2 || db.Queryable<Student_002>().Count() != 0)

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

@ -96,11 +96,11 @@ namespace OrmTest
db.InsertNav(list.First())
.ThenInclude(x => x.school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last())
.ThenInclude(x => x.school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
if (db.Queryable<Desk_003>().Count() != 4 || db.Queryable<Room_003>().Count() != 4
|| db.Queryable<School_003>().Count() != 2 || db.Queryable<Student_003>().Count() != 2)
@ -112,10 +112,10 @@ namespace OrmTest
db.InsertNav(list.First().school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last().school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
if (db.Queryable<Desk_003>().Count() != 4 || db.Queryable<Room_003>().Count() != 4
|| db.Queryable<School_003>().Count() != 2 || db.Queryable<Student_003>().Count() != 0)

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

@ -1,4 +1,5 @@
using System;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -100,11 +101,11 @@ namespace OrmTest
db.InsertNav(list.First())
.ThenInclude(x => x.school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last())
.ThenInclude(x => x.school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
if (db.Queryable<Desk_004>().Count() != 4 || db.Queryable<Room_004>().Count() != 4
|| db.Queryable<School_004>().Count() != 2 || db.Queryable<Student_004>().Count() != 2)
@ -116,11 +117,10 @@ namespace OrmTest
db.InsertNav(list.First().school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
db.InsertNav(list.Last().school_001)
.ThenInclude(x => x.rooms)
.ThenInclude(x => x.desk);
.ThenInclude(x => x.desk).ExecuteCommand();
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)
{

Loading…
Cancel
Save