public void Children() { JValue v = new JValue(true); var c = v.Children(); Assert.AreEqual(JEnumerable <JToken> .Empty, c); }
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); }
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); }