Add unit test

This commit is contained in:
sunkaixuan
2023-06-08 16:58:29 +08:00
parent edffc8a290
commit 2cadf23fcf

View File

@@ -26,9 +26,22 @@ namespace OrmTest
db.CodeFirst.InitTables<CodeFirstChar2>(); db.CodeFirst.InitTables<CodeFirstChar2>();
db.Insertable(new CodeFirstChar2() { CharTest = '1' }).ExecuteCommand(); db.Insertable(new CodeFirstChar2() { CharTest = '1' }).ExecuteCommand();
var list2=db.Queryable<CodeFirstChar2>().ToList(); var list2=db.Queryable<CodeFirstChar2>().ToList();
db.Aop.OnLogExecuting = (s, p) => Console.WriteLine(UtilMethods.GetNativeSql(s, p));
db.CodeFirst.InitTables<CodeFirstsaf>();
db.CodeFirst.InitTables<CODEFIRSTSAF>();
Console.WriteLine("#### CodeFirst end ####"); Console.WriteLine("#### CodeFirst end ####");
} }
} }
public class CodeFirstsaf
{
[SugarColumn(DefaultValue ="")]
public string Json { get; set; }
}
public class CODEFIRSTSAF
{
[SugarColumn(DefaultValue = "a")]
public string Json { get; set; }
}
public class CodeFirstChar2 public class CodeFirstChar2
{ {
[SqlSugar.SugarColumn(ColumnDataType ="varchar(1)")] [SqlSugar.SugarColumn(ColumnDataType ="varchar(1)")]