mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Add unit test
This commit is contained in:
parent
72cab2ab26
commit
c5b4902ec7
50
Src/Asp.Net/PgSqlTest/UnitTest/UCustom013.cs
Normal file
50
Src/Asp.Net/PgSqlTest/UnitTest/UCustom013.cs
Normal file
@ -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<unitduty>().ToList();
|
||||
}
|
||||
public class unitduty
|
||||
{
|
||||
public string person { get; set; }
|
||||
public weekday weekday { get;set; }
|
||||
}
|
||||
public enum weekday
|
||||
{
|
||||
Fri,
|
||||
Thur,
|
||||
Sun
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user