Add unit test

This commit is contained in:
sunkaixuan 2022-06-08 18:59:55 +08:00
parent 72cab2ab26
commit c5b4902ec7

View 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
}
}
}