From 5f45b608bc8ef9615e29cd852e5b9dd4f2628122 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 13 Aug 2023 17:38:58 +0800 Subject: [PATCH] Add unit test --- .../MySqlTest/UnitTest/UnitCreateType.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/MySqlTest/UnitTest/UnitCreateType.cs b/Src/Asp.NetCore2/MySqlTest/UnitTest/UnitCreateType.cs index 7cfb9a3cb..1220232d1 100644 --- a/Src/Asp.NetCore2/MySqlTest/UnitTest/UnitCreateType.cs +++ b/Src/Asp.NetCore2/MySqlTest/UnitTest/UnitCreateType.cs @@ -1,6 +1,7 @@ using SqlSugar; using System; using System.Collections.Generic; +using System.Linq; using System.Text; namespace OrmTest @@ -29,7 +30,20 @@ namespace OrmTest //Console.WriteLine(sql);//输出sql }; }); - + + List ids = new List(); + for (int i = 0; i < 100; i++) + { + var guids = db.Queryable().Select(it => + SqlFunc.NewUid() + ).Take(10).ToList(); ; + ids.AddRange(guids); + } + var count= ids.Distinct().Count(); + if (count != ids.Count) + { + throw new Exception("unit error"); + } db.DbMaintenance.CreateDatabase(); var type = db.DynamicBuilder().CreateClass("UnitEntityA", new SugarTable()