From b3af96998f2702fa5fd4ec4415735e9fa6bd5c92 Mon Sep 17 00:00:00 2001 From: sunkaixuna <610262374@qq.com> Date: Thu, 16 Dec 2021 12:38:19 +0800 Subject: [PATCH] Update unit test --- Src/Asp.Net/MySqlTest/UnitTest/UQueryable.cs | 11 +++++++++++ Src/Asp.Net/SqlServerTest/UnitTest/UQueryable.cs | 11 ++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/MySqlTest/UnitTest/UQueryable.cs b/Src/Asp.Net/MySqlTest/UnitTest/UQueryable.cs index d864eec33..056618b3d 100644 --- a/Src/Asp.Net/MySqlTest/UnitTest/UQueryable.cs +++ b/Src/Asp.Net/MySqlTest/UnitTest/UQueryable.cs @@ -105,6 +105,17 @@ namespace OrmTest x2 = o2, x3 = o3 }).ToList(); + Db.CodeFirst.InitTables(); + Db.Insertable(new UnitEnumadfa()).ExecuteCommand(); + Db.Insertable(new UnitEnumadfa() { Type = DbType.Sqlite }).ExecuteCommand(); + var listEnum = Db.Queryable().ToList(); + } + + + public class UnitEnumadfa + { + [SugarColumn(IsNullable = true)] + public DbType? Type { get; set; } } public static class IEnumerbleContains diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable.cs index 869e37e7b..b7c9de71c 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UQueryable.cs @@ -195,10 +195,19 @@ namespace OrmTest .Select(it => it.CreateTime.ToString("yyyy-MM-dd")).ToList(); Check.Exception(d11111.Last() != "2021-11-30", "unit error"); + + db.CodeFirst.InitTables(); + db.Insertable(new UnitEnumadfa()).ExecuteCommand(); + db.Insertable(new UnitEnumadfa() { Type=DbType.Sqlite}).ExecuteCommand(); + var listEnum=db.Queryable().ToList(); } - + public class UnitEnumadfa + { + [SugarColumn(IsNullable =true)] + public DbType? Type { get; set; } + } public class UnitBytes11 { [SugarColumn(Length =200,IsNullable =true)]