Exemplo n.º 1
0
        public void ItConvertsXmlText()
        {
            var text = new XmlText("lorem & ipsum");
            var json = ToJson.Convert(text).Stringify();

            Assert.AreEqual("\"lorem & ipsum\"", json);
        }
Exemplo n.º 2
0
        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
                );
        }