public void BindBinaryOperationTest() { //// Binary operators: +, -, *, /, %, &, |, ^, <<, >>, ==, !=, >, <, >=, <= //// The '&&' and '||' operators are conditional versions of the '&' and '|' operators. JsonValue value; DynamicMetaObject target; DynamicMetaObject arg; value = AnyInstance.AnyInt; target = GetJsonValueDynamicMetaObject(value); arg = new DynamicMetaObject(Expression.Constant(AnyInstance.AnyInt), BindingRestrictions.Empty, AnyInstance.AnyInt); TestBinaryOperationBinder.TestBindParams(target, arg); TestBinaryOperationBinder.TestMetaObject(target, arg, TestBinaryOperationBinder.NumberOperations); value = AnyInstance.AnyBool; target = GetJsonValueDynamicMetaObject(value); arg = new DynamicMetaObject(Expression.Constant(AnyInstance.AnyBool), BindingRestrictions.Empty, AnyInstance.AnyBool); TestBinaryOperationBinder.TestMetaObject(target, arg, TestBinaryOperationBinder.BoolOperations); arg = target; foreach (JsonValue otherValue in AnyInstance.AnyJsonValueArray) { if (!(otherValue is JsonPrimitive)) { target = GetJsonValueDynamicMetaObject(otherValue); TestBinaryOperationBinder.TestMetaObject(target, arg, TestBinaryOperationBinder.CompareOperations); } } arg = new DynamicMetaObject(Expression.Constant(null), BindingRestrictions.Empty); foreach (JsonValue otherValue in AnyInstance.AnyJsonValueArray) { target = GetJsonValueDynamicMetaObject(otherValue); TestBinaryOperationBinder.TestMetaObject(target, arg, TestBinaryOperationBinder.CompareOperations); } }