예제 #1
0
        public void Combined1()
        {
            var data = DirStructure.OwnTestFileAsBytes("binary/combined1.bindat");
            var reader = new UserBinaryReader(new MemoryStream(data));

            ReaderTestCommon.Combined1(reader);
        }
예제 #2
0
        public void Combined1()
        {
            var data   = DirStructure.OwnTestFileAsBytes("text/combined1.ion");
            var reader = new UserTextReader(new MemoryStream(data));

            ReaderTestCommon.Combined1(reader);

            reader = new UserTextReader(Encoding.UTF8.GetString(data));
            ReaderTestCommon.Combined1(reader);
        }
예제 #3
0
        public void NestedAndCombinedListStructTest()
        {
            //Must be:
            // {
            //   menu: {
            //     id: "file",
            //     popup: [
            //       "Open",
            //       "Load",
            //       "Close"
            //     ],
            //     deep1: {
            //       deep2: {
            //         deep3: {
            //           deep4val: "enddeep"
            //         }
            //       }
            //     },
            //     positions: [
            //       1234,
            //       5678,
            //       90
            //     ]
            //   }
            // }

            var popupList = _ionValueFactory.NewEmptyList();

            popupList.Add(_ionValueFactory.NewString("Open"));
            popupList.Add(_ionValueFactory.NewString("Load"));
            popupList.Add(_ionValueFactory.NewString("Close"));

            var positionList = _ionValueFactory.NewEmptyList();

            positionList.Add(_ionValueFactory.NewInt(1234));
            positionList.Add(_ionValueFactory.NewInt(5678));
            positionList.Add(_ionValueFactory.NewInt(90));

            var deep3 = new IonStruct {
                { "deep4val", _ionValueFactory.NewString("enddeep") }
            };

            var deep2 = new IonStruct {
                { "deep3", deep3 }
            };

            var deep1 = new IonStruct {
                { "deep2", deep2 }
            };

            var menu = new IonStruct
            {
                { "id", _ionValueFactory.NewString("file") },
                { "popup", popupList },
                { "deep1", deep1 },
                { "positions", positionList }
            };

            var value = new IonStruct {
                { "menu", menu }
            };
            var reader = new UserTreeReader(value);

            ReaderTestCommon.Combined1(reader);
        }