コード例 #1
0
        public void JmesPathMultiSelectList()
        {
            JmesPathMultiSelectList expression = new JmesPathMultiSelectList(
                new JmesPathIdentifier("foo"),
                new JmesPathIdentifier("bar"));

            Assert(expression, "{\"foo\": \"a\", \"bar\": \"b\", \"baz\": \"c\"}", "[\"a\",\"b\"]");
            Assert(expression, "{\"foo\": \"a\", \"baz\": \"b\"}", "[\"a\",null]");

            expression = new JmesPathMultiSelectList(
                new JmesPathIdentifier("foo"),
                new JmesPathSubExpression(
                    new JmesPathIdentifier("bar"),
                    new JmesPathIdentifier("baz")
                    )
                );

            Assert(expression, "{\"foo\": \"a\", \"bar\": {\"baz\": \"b\"}}", "[\"a\",\"b\"]");

            expression = new JmesPathMultiSelectList(
                new JmesPathIdentifier("foo"),
                new JmesPathIndexExpression(
                    new JmesPathIdentifier("bar"),
                    new JmesPathIndex(0)
                    )
                );

            Assert(expression, "{\"foo\": \"a\", \"bar\": [\"b\"], \"baz\": \"c\"}", "[\"a\",\"b\"]");
        }
コード例 #2
0
        public void PopMultiSelectList()
        {
            System.Diagnostics.Debug.Assert(selectLists_.Count > 0);
            var items      = selectLists_.Pop();
            var expression = new JmesPathMultiSelectList(items);

            expressions_.Push(expression);
        }