Add unit test

This commit is contained in:
sunkaixuan 2024-05-06 18:50:29 +08:00
parent 6ce9580620
commit ab3a0d5dcd
2 changed files with 33 additions and 0 deletions

View File

@ -33,6 +33,7 @@ namespace OrmTest
}
public static void Init()
{
UnitEnumTest.Init();
Unitadf1yaadfa.Init();
CrossDatabase03.Init();
CrossDatabase02.Init();

View File

@ -0,0 +1,32 @@
using MySqlConnector.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
internal class UnitEnumTest
{
public static void Init()
{
var db = NewUnitTest.Db;
db.CodeFirst.InitTables<UnitadfadfaaEnum>();
var s = new List<UnitadfadfaaEnum>() {
new UnitadfadfaaEnum(){ Id=1, DbType=SqlSugar.DbType.Sqlite}
};
db.Queryable<UnitadfadfaaEnum>()
.Where(it => s.Any(s => s.Id == it.Id && s.DbType == it.DbType))
.ToList();
}
public class UnitadfadfaaEnum
{
[SqlSugar.SugarColumn(IsPrimaryKey =true,IsIdentity =true)]
public int Id { get; set; }
public SqlSugar.DbType DbType { get; set; }
}
}
}