-Added DeserializeNode overload to specify a root element

This commit is contained in:
JamesNK
2009-01-06 09:36:04 +00:00
parent a7b631a5f9
commit 663540f349
4 changed files with 37 additions and 2 deletions
@@ -455,6 +455,16 @@ namespace Newtonsoft.Json.Tests.Converters
XmlDocument newDoc = (XmlDocument)JsonConvert.DeserializeXmlNode(strJSON);
}
[Test]
public void MultipleRootPropertiesAddRootElement()
{
string strJSON = @"{""count"": 773840,""photos"": 773840}";
XmlDocument newDoc = (XmlDocument)JsonConvert.DeserializeXmlNode(strJSON, "myRoot");
Assert.AreEqual(@"<myRoot><count>773840</count><photos>773840</photos></myRoot>", newDoc.InnerXml);
}
}
}
#endif
@@ -359,6 +359,5 @@ Parameter name: arrayIndex")]
person = person;
}
}
}