Browse Source

Add unit test

pull/40/head
sunkaixuan 1 year ago
parent
commit
4a2f11d954
  1. 12
      Src/Asp.Net/SqlServerTest/UnitTest/UnitUpdateNavN3.cs

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

@ -36,6 +36,18 @@ namespace OrmTest
//导航插入三表数据 //导航插入三表数据
db.InsertNav(a).Include(t => t.B).ThenInclude(t => t.C).ExecuteCommand(); db.InsertNav(a).Include(t => t.B).ThenInclude(t => t.C).ExecuteCommand();
var list3 = db.Queryable<ClassA>()
.Includes(t => t.B, t => t.C).Where(it=>it.B.Any(z=>z.C.Any(s=>s.CId=="a5"))).ToList();
var list4 = db.Queryable<ClassA>()
.Includes(t => t.B, t => t.C).Where(it => it.B.Any(z => z.C.Any(s => s.CId == "c"))).ToList();
if (list3.Count > 0 || list4.Count == 0)
{
throw new Exception("unit error");
}
//修改数据 修改b表id 修改c表对应b表id //修改数据 修改b表id 修改c表对应b表id
b.BId = "bb"; b.BId = "bb";
c.BId = "bb"; c.BId = "bb";

Loading…
Cancel
Save