public void ItConvertsXmlText() { var text = new XmlText("lorem & ipsum"); var json = ToJson.Convert(text).Stringify(); Assert.AreEqual("\"lorem & ipsum\"", json); }
public void ItConvertsXmlNonPairElement() { var element = new XmlElement("foo", false); element.Attributes.Add(new XmlAttribute("lorem", new XmlText("ipsum"))); var json = ToJson.Convert(element).Stringify(); Assert.AreEqual( @"{""tag"": ""foo"", ""attributes"": {""lorem"": ""ipsum""}, ""pair"": false, ""content"": []}", json ); }