Add unit test

This commit is contained in:
sunkaixuan
2025-04-28 20:41:49 +08:00
parent cadf908ef9
commit e1cb4bebec

View File

@@ -52,6 +52,7 @@ namespace OrmTest
Test01(db);
Test02(db);
Test03(db);
Test04(db);
}
private static void Test01(SqlSugarClient db)
@@ -96,6 +97,20 @@ namespace OrmTest
throw new Exception("unit error");
}
}
private static void Test04(SqlSugarClient db)
{
var num = 10;
var value = db.Queryable<Test001faf1aaa>()
.Select(it => new Test001faf1aaa
{
Id = num == 1 ? 1 : num == 2 ? 2 : num== it.Id?4:5
})
.First().Id;
if (value != 5)
{
throw new Exception("unit error");
}
}
[SqlSugar.SugarTable("unitdafaf1311")]
public class Test001faf1aaa