mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update unit test
This commit is contained in:
parent
bbc6fc45fb
commit
17705cf145
@ -10,12 +10,29 @@ namespace OrmTest
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
Demo5();
|
||||
Demo4();
|
||||
Demo3();
|
||||
Demo2();
|
||||
Demo1();
|
||||
}
|
||||
|
||||
private static void Demo5()
|
||||
{
|
||||
var db = NewUnitTest.Db;
|
||||
List<IConditionalModel> conModels = new List<IConditionalModel>();
|
||||
conModels.Add(new ConditionalModel() { FieldName = "id", ConditionalType = ConditionalType.NoEqual, FieldValue = "1" });
|
||||
conModels.Add(new ConditionalModel() { FieldName = "id", ConditionalType = ConditionalType.IsNot, FieldValue = null });
|
||||
var json = db.Context.Utilities.SerializeObject(conModels);
|
||||
var conditionalModels = db.Context.Utilities.JsonToConditionalModels(json);
|
||||
var list6 = db.Queryable<Order>().Where(conditionalModels).ToList();
|
||||
var json2 = db.Context.Utilities.SerializeObject(conditionalModels);
|
||||
if (json != json2)
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
}
|
||||
|
||||
private static void Demo1()
|
||||
{
|
||||
var db = NewUnitTest.Db;
|
||||
|
Loading…
Reference in New Issue
Block a user