From e1ad221ebe21181ad93b54f2820aa9f7ca5fbc72 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 25 Jun 2022 14:41:30 +0800 Subject: [PATCH] Add unit test --- Src/Asp.NetCore2/MySqlTest/UnitTest/UCodeFirst.cs | 7 +++++++ Src/Asp.NetCore2/PgSqlTest/UnitTest/UCodeFirst.cs | 7 +++++++ Src/Asp.NetCore2/SqliteTest/UnitTest/UCodeFirst.cs | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/Src/Asp.NetCore2/MySqlTest/UnitTest/UCodeFirst.cs b/Src/Asp.NetCore2/MySqlTest/UnitTest/UCodeFirst.cs index 6873c95fb..7238d6160 100644 --- a/Src/Asp.NetCore2/MySqlTest/UnitTest/UCodeFirst.cs +++ b/Src/Asp.NetCore2/MySqlTest/UnitTest/UCodeFirst.cs @@ -14,6 +14,13 @@ namespace OrmTest Db.DbMaintenance.DropTable("UnitCodeTest1"); Db.CodeFirst.InitTables(); Db.CodeFirst.InitTables(); + Db.CodeFirst.InitTables(); + } + [SqlSugar.SugarIndex("UnitIndextestIndex", nameof(UnitIndextest.Table), SqlSugar.OrderByType.Asc)] + public class UnitIndextest + { + public string Table { get; set; } + public string Id { get; set; } } public class UnitCodeTest1 { diff --git a/Src/Asp.NetCore2/PgSqlTest/UnitTest/UCodeFirst.cs b/Src/Asp.NetCore2/PgSqlTest/UnitTest/UCodeFirst.cs index 099832be8..28a0c4353 100644 --- a/Src/Asp.NetCore2/PgSqlTest/UnitTest/UCodeFirst.cs +++ b/Src/Asp.NetCore2/PgSqlTest/UnitTest/UCodeFirst.cs @@ -13,6 +13,13 @@ namespace OrmTest if (Db.DbMaintenance.IsAnyTable("UnitCodeTest1", false)) Db.DbMaintenance.DropTable("UnitCodeTest1"); Db.CodeFirst.InitTables(); + Db.CodeFirst.InitTables(); + } + [SqlSugar.SugarIndex("UnitIndextestIndex", nameof(UnitIndextest.Table), SqlSugar.OrderByType.Asc)] + public class UnitIndextest + { + public string Table { get; set; } + public string Id { get; set; } } public class UnitCodeTest1 { diff --git a/Src/Asp.NetCore2/SqliteTest/UnitTest/UCodeFirst.cs b/Src/Asp.NetCore2/SqliteTest/UnitTest/UCodeFirst.cs index b5e9aa229..eca277018 100644 --- a/Src/Asp.NetCore2/SqliteTest/UnitTest/UCodeFirst.cs +++ b/Src/Asp.NetCore2/SqliteTest/UnitTest/UCodeFirst.cs @@ -28,6 +28,13 @@ namespace OrmTest if (x[0].Length != 18 && x[0].Scale != 0) throw new Exception("unit test error"); if (x[1].Length != 18 && x[1].Scale != 2) throw new Exception("unit test error"); if (x[2].Length != 0 && x[2].Scale != 0) throw new Exception("unit test error"); + Db.CodeFirst.InitTables(); + } + [SqlSugar.SugarIndex("UnitIndextestIndex", nameof(UnitIndextest.Table), SqlSugar.OrderByType.Asc)] + public class UnitIndextest + { + public string Table { get; set; } + public string Id { get; set; } } public class UnitByteArray1