Esempio n. 1
0
        public void testParsingVector256()
        {
            // This was a test case for a bug found in ripple-lib js
            string jsonHexed =
                "110064220000000058000360186E008422E06B72D5B275E29EE3BE9D87A370F424E0E7BF613C4659098214289D19799C892637306AAAF03805EDFCDF6C28B8011320081342A0AB45459A54D8E4FA1842339A102680216CF9A152BCE4F4CE467D8246";
            StObject meta = StObject.OutTranslate.FromHex(jsonHexed);
            string   expectedJSON;

            expectedJSON =
                "{\"LedgerEntryType\":\"DirectoryNode\",\"Indexes\":[\"081342A0AB45459A54D8E4FA1842339A102680216CF9A152BCE4F4CE467D8246\"],\"Owner\":\"rh6kN9s7spSb3vdv6H8ZGYzsddSLeEUGmc\",\"RootIndex\":\"000360186E008422E06B72D5B275E29EE3BE9D87A370F424E0E7BF613C465909\",\"Flags\":0}";

            var parsedJson = JObject.Parse(expectedJSON);
            var jObj       = meta.ToJObject();

            foreach (var keyPair in parsedJson)
            {
                JToken val;
                if (jObj.TryGetValue(keyPair.Key, out val))
                {
                    Assert.AreEqual(keyPair.Value, val);
                }
            }

            //Assert.AreEqual(expectedJSON, meta.ToJObject().ToString(Formatting.None));
        }