public void BindBinaryOperationInvalidTest()
        {
            DynamicMetaObject target;

            DynamicMetaObject argPrimitive    = new DynamicMetaObject(Expression.Constant(10), BindingRestrictions.Empty);
            DynamicMetaObject argNonPrimitive = new DynamicMetaObject(Expression.Constant(AnyInstance.AnyJsonObject), BindingRestrictions.Empty);

            foreach (JsonValue value in AnyInstance.AnyJsonValueArray)
            {
                target = GetJsonValueDynamicMetaObject(value);

                TestBinaryOperationBinder.TestMetaObject(target, argPrimitive, TestBinaryOperationBinder.UnsupportedOperations, false);
            }

            foreach (JsonValue value in AnyInstance.AnyJsonValueArray)
            {
                target = GetJsonValueDynamicMetaObject(value);

                if (value is JsonPrimitive)
                {
                    //// not supported on operand of type JsonValue if it isn't a primitive and not comparing JsonValue types.
                    TestBinaryOperationBinder.TestMetaObject(target, argNonPrimitive, TestBinaryOperationBinder.NumberOperations, false);
                    TestBinaryOperationBinder.TestMetaObject(target, argNonPrimitive, TestBinaryOperationBinder.BoolOperations, false);
                }
                else
                {
                    //// When value is non-primitive, it must be a compare operation and (the other operand must be null or a JsonValue)
                    TestBinaryOperationBinder.TestMetaObject(target, argPrimitive, TestBinaryOperationBinder.NumberOperations, false);
                    TestBinaryOperationBinder.TestMetaObject(target, argPrimitive, TestBinaryOperationBinder.BoolOperations, false);
                }
            }
        }
        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);
            }
        }