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
6ce9580620
commit
ab3a0d5dcd
@ -33,6 +33,7 @@ namespace OrmTest
|
|||||||
}
|
}
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
UnitEnumTest.Init();
|
||||||
Unitadf1yaadfa.Init();
|
Unitadf1yaadfa.Init();
|
||||||
CrossDatabase03.Init();
|
CrossDatabase03.Init();
|
||||||
CrossDatabase02.Init();
|
CrossDatabase02.Init();
|
||||||
|
@ -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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user