From c5b4902ec781a1087587581316b30cdb6a4a6a39 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 8 Jun 2022 18:59:55 +0800 Subject: [PATCH] Add unit test --- Src/Asp.Net/PgSqlTest/UnitTest/UCustom013.cs | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Src/Asp.Net/PgSqlTest/UnitTest/UCustom013.cs diff --git a/Src/Asp.Net/PgSqlTest/UnitTest/UCustom013.cs b/Src/Asp.Net/PgSqlTest/UnitTest/UCustom013.cs new file mode 100644 index 000000000..baf8c0907 --- /dev/null +++ b/Src/Asp.Net/PgSqlTest/UnitTest/UCustom013.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest +{ + public class UCustom013 + { + public static void Init() + { + var db = NewUnitTest.Db; + try + { + db.Ado.ExecuteCommand("create type week as enum('Sun','Mon','Tues','Wed','Thur','Fri','Sat');"); + db.Ado.ExecuteCommand(@"create table unitduty( + person text, + weekday week + ); "); + } + catch + { + + } + db.CurrentConnectionConfig.MoreSettings = new SqlSugar.ConnMoreSettings() + { + TableEnumIsString = true, + }; + //db.Insertable(new unitduty() + //{ + // weekday = weekday.Fri, + // person="a" + //}).ExecuteCommand(); + var list=db.Queryable().ToList(); + } + public class unitduty + { + public string person { get; set; } + public weekday weekday { get;set; } + } + public enum weekday + { + Fri, + Thur, + Sun + } + + } +}