@@ -1153,12 +1153,32 @@ public static IEnumerable<TestCaseData> TestCasesForWithCustomVariablesExpressio
1153
1153
yield return new TestCaseData ( "string.IsNullOrEmpty(nullVar) || nullVar.StartsWith(\" ABC\" ) == false" , onInstanceVariables , true ) . SetCategory ( "Instance Property,Or Conditional" ) . Returns ( true ) ;
1154
1154
yield return new TestCaseData ( "!string.IsNullOrEmpty(nullVar) && nullVar.Length < 2" , onInstanceVariables , true ) . SetCategory ( "Instance Property,And Conditional" ) . Returns ( false ) ;
1155
1155
yield return new TestCaseData ( "string.IsNullOrEmpty(nullVar) || nullVar.Length < 2" , onInstanceVariables , true ) . SetCategory ( "Instance Property,Or Conditional" ) . Returns ( true ) ;
1156
- yield return new TestCaseData ( "true || 1/0 == 0" , onInstanceVariables , true ) . SetCategory ( "Instance Property,Or Conditional" ) . Returns ( true ) ;
1156
+ yield return new TestCaseData ( "true || 1/0 == 0" , onInstanceVariables , true ) . SetCategory ( "Instance Property,Or Conditional" ) . Returns ( true ) ;
1157
1157
yield return new TestCaseData ( "false && true || true" , onInstanceVariables , true ) . SetCategory ( "Instance Property,Or Conditional,And Conditional,Precedence check" ) . Returns ( true ) ;
1158
1158
yield return new TestCaseData ( "true || true && false" , onInstanceVariables , true ) . SetCategory ( "Instance Property,Or Conditional,And Conditional,Precedence check" ) . Returns ( true ) ;
1159
1159
yield return new TestCaseData ( "false && nullVar.What ? nullVar.Text : \" Hello\" " , onInstanceVariables , true ) . SetCategory ( "Instance Property,Ternary operator, And Conditional" ) . Returns ( "Hello" ) ;
1160
1160
yield return new TestCaseData ( "false && (false && nullVar.What ? nullVar.boolValue : true) ? nullVar.Text : \" Hello\" " , onInstanceVariables , true ) . SetCategory ( "Instance Property,Ternary operator, And Conditional" ) . Returns ( "Hello" ) ;
1161
1161
1162
+ #endregion
1163
+
1164
+ #region ExpandoObject
1165
+
1166
+ dynamic MyDynamic = new System . Dynamic . ExpandoObject ( ) ;
1167
+ MyDynamic . NullValue = null ;
1168
+ MyDynamic . Number = 11 ;
1169
+
1170
+ Dictionary < string , object > ExpandoObjectVariables = new Dictionary < string , object > ( )
1171
+ {
1172
+ { "expObj" , MyDynamic } ,
1173
+ } ;
1174
+
1175
+ yield return new TestCaseData ( "expObj.Number" , ExpandoObjectVariables , true ) . SetCategory ( "ExpandoObject" ) . SetCategory ( "Instance Property" ) . Returns ( 11 ) ;
1176
+
1177
+ #region bug #67
1178
+ yield return new TestCaseData ( "expObj.NullValue" , ExpandoObjectVariables , true ) . SetCategory ( "ExpandoObject" ) . SetCategory ( "Instance Property" ) . Returns ( null ) ;
1179
+ yield return new TestCaseData ( "expObj.NullValue ?? \" A\" " , ExpandoObjectVariables , true ) . SetCategory ( "ExpandoObject" ) . SetCategory ( "Instance Property" ) . Returns ( "A" ) ;
1180
+ #endregion
1181
+
1162
1182
1163
1183
#endregion
1164
1184
0 commit comments