Add unit test

This commit is contained in:
sunkaixuan
2023-06-24 15:08:47 +08:00
parent b6edcde506
commit 8b39edefb5
2 changed files with 6 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ namespace OrmTest
} }
public static void Init() public static void Init()
{ {
UnitUpdateOneToMany.Init();
UQueryableByObject.Init(); UQueryableByObject.Init();
Unit23131.Init(); Unit23131.Init();
SplitTest2(); SplitTest2();

View File

@@ -1,6 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using SqlSugar; using SqlSugar;
namespace OrmTest namespace OrmTest
@@ -55,6 +55,10 @@ namespace OrmTest
var list3=db.Queryable<Country>().Includes(x => x.Provinces).ToList(); var list3=db.Queryable<Country>().Includes(x => x.Provinces).ToList();
db.QueryFilter.Clear<Province>(); db.QueryFilter.Clear<Province>();
var list4 = db.Queryable<Country>().Includes(x => x.Provinces).ToList(); var list4 = db.Queryable<Country>().Includes(x => x.Provinces).ToList();
if (list3.First().Provinces.Count != 1 || list4.First().Provinces.Count != 2)
{
throw new Exception("unit error");
}
} }