예제 #1
0
        public void MapWithArrayOfMaps()
        {
            var obj = new MockSyncLookup("arr", new MockSyncArray(new MockSyncLookup("v", "this/foo")));

            RunTest(
                input: obj,
                query: @"$x = { arr: [ { v: 'this/foo' }, { v: 'this/bar' } ] }; $x.arr { v }",
                expected: new [] { new { v = "this/foo" }, new { v = "this/bar" } });
        }
예제 #2
0
        public void NestedSimplifiedSyntaxWithLookupsTrivial()
        {
            // Similar to the test above, but with lookups.
            var lookup = new MockSyncLookup("a", 1);

            RunTest(
                expected: ParseObj("{a: 1}"),
                input: lookup,
                query: "{a}"
                );
        }
예제 #3
0
        public void NestedSimplifiedSyntaxWithLookups()
        {
            // Similar to the test above, but with lookups.
            var lookup = new MockSyncLookup("a",
                                            new MockSyncLookup("b", new [] {
                new MockSyncLookup("c", 1),
                new MockSyncLookup("c", 2)
            }).ToBifoqlObject());

            var map = new { a = new { b = new [] { new { c = 1 }, new { c = 2 } } } };

            RunTest(
                expected: ParseObj("{a: {b: [{c: 1}, {c: 2}]}}"),
                input: lookup,
                query: "@ | { a { b { c } } }"
                );
        }