Add unit test

This commit is contained in:
sunkaixuan 2023-07-10 20:27:34 +08:00
parent 47f9d0b304
commit 4a2f11d954

View File

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