Exemple #1
0
        public void Children()
        {
            JValue v = new JValue(true);
            var    c = v.Children();

            Assert.AreEqual(JEnumerable <JToken> .Empty, c);
        }
Exemple #2
0
        private object[] GetCorrespondingObjects(JValue originalObject, JContainer[] objects)
        {
            var correspondingObjects = new object[objects.Length];
            var id = JSONTools.GetID(originalObject);

            if (id == null)
            {
                if (originalObject.Children().Count() == 1)
                {
                    for (var i = 0; i < objects.Length; i++)
                    {
                        var obj = objects[i];
                        if (obj.Count == 1)
                        {
                            correspondingObjects[i] = obj[0];
                        }
                        else
                        {
                            throw new NotImplementedException("Finding corresponding objects for nodes without id not implemented.");
                        }
                    }
                }
                else
                {
                    throw new NotImplementedException("Finding corresponding nodes objects nodes without id not implemented.");
                }
            }
            else
            {
                for (var i = 0; i < objects.Length; i++)
                {
                    var obj   = objects[i];
                    var objID = JSONTools.GetID(obj);
                    if (objID == id)
                    {
                        correspondingObjects[i] = obj;
                    }
                }
            }
            return(correspondingObjects);
        }
Exemple #3
0
 public void Children()
 {
     JValue v = new JValue(true);
     var    c = v.Children();
 }
 public void Children()
 {
   JValue v = new JValue(true);
   var c = v.Children();
   Assert.AreEqual(JEnumerable<JToken>.Empty, c);
 }