|
|
@ -59,8 +59,8 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereMultiple); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"it\".\"Id\" > @Id0 )", new List<SugarParameter>() { |
|
|
|
new SugarParameter("@Id0",1) |
|
|
|
base.Check(value, pars, "( \"it\".\"Id\" > :Id0 )", new List<SugarParameter>() { |
|
|
|
new SugarParameter(":Id0",1) |
|
|
|
}, "WhereMultiple1"); |
|
|
|
} |
|
|
|
private void WhereMultiple2() |
|
|
@ -72,11 +72,11 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereMultiple); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, " (((( \"it\".\"Id\" > @Id0 ) AND ( \"it\".\"Name\" <> @Name1 )) OR ( \"it\".\"Id\" = @Id2 )) OR ( \"it\".\"Name\" = @Name3 ))", new List<SugarParameter>() { |
|
|
|
new SugarParameter("@Id0",1), |
|
|
|
new SugarParameter("@Name1","a"), |
|
|
|
new SugarParameter("@Id2",1), |
|
|
|
new SugarParameter("@Name3","a1") |
|
|
|
base.Check(value, pars, " (((( \"it\".\"Id\" > :Id0 ) AND ( \"it\".\"Name\" <> :Name1 )) OR ( \"it\".\"Id\" = :Id2 )) OR ( \"it\".\"Name\" = :Name3 ))", new List<SugarParameter>() { |
|
|
|
new SugarParameter(":Id0",1), |
|
|
|
new SugarParameter(":Name1","a"), |
|
|
|
new SugarParameter(":Id2",1), |
|
|
|
new SugarParameter(":Name3","a1") |
|
|
|
}, "WhereMultiple2"); |
|
|
|
} |
|
|
|
private void whereSingle1() |
|
|
@ -86,8 +86,8 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"Id\" > @Id0 )", new List<SugarParameter>() { |
|
|
|
new SugarParameter("@Id0",1) |
|
|
|
base.Check(value, pars, "( \"Id\" > :Id0 )", new List<SugarParameter>() { |
|
|
|
new SugarParameter(":Id0",1) |
|
|
|
}, "whereSingle1"); |
|
|
|
} |
|
|
|
private void whereSingle2() |
|
|
@ -97,8 +97,8 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( @Id0 > \"Id\" )", new List<SugarParameter>() { |
|
|
|
new SugarParameter("@Id0",1) |
|
|
|
base.Check(value, pars, "( :Id0 > \"Id\" )", new List<SugarParameter>() { |
|
|
|
new SugarParameter(":Id0",1) |
|
|
|
}, "whereSingle2"); |
|
|
|
} |
|
|
|
private void whereSingle3() |
|
|
@ -108,9 +108,9 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, " (( \"Id\" > @Id0 ) OR ( \"Name\" = @Name1 ))", new List<SugarParameter>() { |
|
|
|
new SugarParameter("@Id0",1), |
|
|
|
new SugarParameter("@Name1","a") |
|
|
|
base.Check(value, pars, " (( \"Id\" > :Id0 ) OR ( \"Name\" = :Name1 ))", new List<SugarParameter>() { |
|
|
|
new SugarParameter(":Id0",1), |
|
|
|
new SugarParameter(":Name1","a") |
|
|
|
}, "whereSingle3"); |
|
|
|
} |
|
|
|
private void whereSingle4() |
|
|
@ -120,10 +120,10 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, " ((( \"Id\" > @Id0 ) AND ( \"Name\" <> @Name1 )) OR ( \"Name\" = @Name2 )) ", new List<SugarParameter>() { |
|
|
|
new SugarParameter("@Id0",1), |
|
|
|
new SugarParameter("@Name1","a"), |
|
|
|
new SugarParameter("@Name2","a1") |
|
|
|
base.Check(value, pars, " ((( \"Id\" > :Id0 ) AND ( \"Name\" <> :Name1 )) OR ( \"Name\" = :Name2 )) ", new List<SugarParameter>() { |
|
|
|
new SugarParameter(":Id0",1), |
|
|
|
new SugarParameter(":Name1","a"), |
|
|
|
new SugarParameter(":Name2","a1") |
|
|
|
}, "whereSingle4"); |
|
|
|
} |
|
|
|
private void whereSingle5() |
|
|
@ -135,10 +135,10 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, " ((( \"Id\" > @Id0 ) AND ( \"Name\" <> @Name1 )) OR ( \"Name\" = @Name2 )) ", new List<SugarParameter>() { |
|
|
|
new SugarParameter("@Id0",1), |
|
|
|
new SugarParameter("@Name1","a"), |
|
|
|
new SugarParameter("@Name2","a1") |
|
|
|
base.Check(value, pars, " ((( \"Id\" > :Id0 ) AND ( \"Name\" <> :Name1 )) OR ( \"Name\" = :Name2 )) ", new List<SugarParameter>() { |
|
|
|
new SugarParameter(":Id0",1), |
|
|
|
new SugarParameter(":Name1","a"), |
|
|
|
new SugarParameter(":Name2","a1") |
|
|
|
}, "whereSingle5"); |
|
|
|
} |
|
|
|
private void whereSingle6() |
|
|
@ -150,11 +150,11 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, " (((( \"Id\" > @Id0 ) AND ( \"Name\" <> @Name1 )) OR ( \"Id\" = @Id2 )) OR ( \"Name\" = @Name3 ))", new List<SugarParameter>() { |
|
|
|
new SugarParameter("@Id0",1), |
|
|
|
new SugarParameter("@Name1","a"), |
|
|
|
new SugarParameter("@Id2",1), |
|
|
|
new SugarParameter("@Name3","a1") |
|
|
|
base.Check(value, pars, " (((( \"Id\" > :Id0 ) AND ( \"Name\" <> :Name1 )) OR ( \"Id\" = :Id2 )) OR ( \"Name\" = :Name3 ))", new List<SugarParameter>() { |
|
|
|
new SugarParameter(":Id0",1), |
|
|
|
new SugarParameter(":Name1","a"), |
|
|
|
new SugarParameter(":Id2",1), |
|
|
|
new SugarParameter(":Name3","a1") |
|
|
|
}, "whereSingle6"); |
|
|
|
} |
|
|
|
private void whereSingle7(Student st) |
|
|
@ -164,8 +164,8 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"Id\" > @Id0 )", new List<SugarParameter>() { |
|
|
|
new SugarParameter("@Id0",1) |
|
|
|
base.Check(value, pars, "( \"ID\" > :Id0 )", new List<SugarParameter>() { |
|
|
|
new SugarParameter(":Id0",1) |
|
|
|
}, "whereSingle7"); |
|
|
|
} |
|
|
|
|
|
|
@ -176,7 +176,7 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"Name\" IS NULL )", new List<SugarParameter>() { |
|
|
|
base.Check(value, pars, "( \"NAME\" IS NULL )", new List<SugarParameter>() { |
|
|
|
|
|
|
|
}, "whereSingle8"); |
|
|
|
} |
|
|
@ -188,9 +188,9 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"Name\" = @Name0 )", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "( \"NAME\" = :Name0 )", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
new SugarParameter("@Name0",null) |
|
|
|
new SugarParameter(":Name0",null) |
|
|
|
}, "whereSingle9"); |
|
|
|
} |
|
|
|
|
|
|
@ -229,9 +229,9 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"Bool1\" = @Bool10 )", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "( \"BOOL1\" = :Bool10 )", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
new SugarParameter("@Bool10",true) |
|
|
|
new SugarParameter(":Bool10",true) |
|
|
|
}, "whereSingle12"); |
|
|
|
} |
|
|
|
|
|
|
@ -242,7 +242,7 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"Name\" IS NOT NULL )", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "( \"NAME\" IS NOT NULL )", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
|
|
|
|
}, "whereSingle13"); |
|
|
@ -255,7 +255,7 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "(( 1 = 1 ) AND( \"Name\" IS NOT NULL ))", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "(( 1 = 1 ) AND( \"NAME\" IS NOT NULL ))", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
|
|
|
|
}, "whereSingle14"); |
|
|
@ -268,9 +268,9 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"Money2\" = @Const0 )", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "( \"MONEY2\" = :Const0 )", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
new SugarParameter("@Const0",1) |
|
|
|
new SugarParameter(":Const0",1) |
|
|
|
}, "whereSingle15"); |
|
|
|
} |
|
|
|
|
|
|
@ -283,9 +283,9 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"String\" = @Const0 )", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "( \"String\" = :Const0 )", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
new SugarParameter("@Const0",dic["key"]) |
|
|
|
new SugarParameter(":Const0",dic["key"]) |
|
|
|
}, "whereSingle16"); |
|
|
|
} |
|
|
|
|
|
|
@ -296,9 +296,9 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "(( 1 = 1 ) AND (\"String\" like '%'+@MethodConst1+'%') )", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "(( 1 = 1 ) AND (\"STRING\" like '%'+:MethodConst1+'%') )", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
new SugarParameter("@MethodConst1","a") |
|
|
|
new SugarParameter(":MethodConst1","a") |
|
|
|
}, "whereSingle17"); |
|
|
|
} |
|
|
|
|
|
|
@ -309,7 +309,7 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "NOT ( \"Bool1\"=1 ) ", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "NOT ( \"BOOL1\"=1 ) ", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
|
|
|
|
}, "whereSingle18"); |
|
|
@ -321,9 +321,9 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"Bool2\" = @Value0 )", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "( \"BOOL2\" = :Value0 )", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
new SugarParameter("@Value0",false) |
|
|
|
new SugarParameter(":Value0",false) |
|
|
|
}, "whereSingle19"); |
|
|
|
} |
|
|
|
private void whereSingle20() |
|
|
@ -333,7 +333,7 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"Bool2\" = \"Bool1\" )", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "( \"BOOL2\" = \"BOOL1\" )", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
|
|
|
|
}, "whereSingle19"); |
|
|
@ -346,7 +346,7 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"Bool2\"=1 )", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "( \"BOOL2\"=1 )", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
|
|
|
|
}, "whereSingle21"); |
|
|
@ -359,7 +359,7 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "NOT ( \"Bool2\"=1 ) ", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "NOT ( \"BOOL2\"=1 ) ", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
|
|
|
|
}, "whereSingle22"); |
|
|
@ -373,9 +373,9 @@ namespace OrmTest.UnitTest |
|
|
|
expContext.Resolve(exp, ResolveExpressType.WhereSingle); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "( \"Decimal2\" = @Const0 )", new List<SugarParameter>() |
|
|
|
base.Check(value, pars, "( \"DECIMAL2\" = :Const0 )", new List<SugarParameter>() |
|
|
|
{ |
|
|
|
new SugarParameter("@Const0",val) |
|
|
|
new SugarParameter(":Const0",val) |
|
|
|
}, "whereSingle23"); |
|
|
|
} |
|
|
|
} |
|
|
|