From 4a2f11d954384b9f34745e6eb422e1e9a32e2da8 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 10 Jul 2023 20:27:34 +0800 Subject: [PATCH] Add unit test --- .../SqlServerTest/UnitTest/UnitUpdateNavN3.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UnitUpdateNavN3.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UnitUpdateNavN3.cs index ecdc856c0..d67f5e0b7 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UnitUpdateNavN3.cs +++ b/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(); + + var list3 = db.Queryable() + .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() + .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.BId = "bb"; c.BId = "bb";