mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
Add unit test
This commit is contained in:
@@ -52,6 +52,7 @@ namespace OrmTest
|
|||||||
Test01(db);
|
Test01(db);
|
||||||
Test02(db);
|
Test02(db);
|
||||||
Test03(db);
|
Test03(db);
|
||||||
|
Test04(db);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Test01(SqlSugarClient db)
|
private static void Test01(SqlSugarClient db)
|
||||||
@@ -96,6 +97,20 @@ namespace OrmTest
|
|||||||
throw new Exception("unit error");
|
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")]
|
[SqlSugar.SugarTable("unitdafaf1311")]
|
||||||
public class Test001faf1aaa
|
public class Test001faf1aaa
|
||||||
|
Reference in New Issue
Block a user