public virtual void TestMessageAddingChild() { iText.StyledXmlParser.Jsoup.Nodes.Element jsoupSVGRoot = new iText.StyledXmlParser.Jsoup.Nodes.Element(iText.StyledXmlParser.Jsoup.Parser.Tag .ValueOf("svg"), ""); INode root = new JsoupElementNode(jsoupSVGRoot); root.AddChild(null); NUnit.Framework.Assert.AreEqual(0, root.ChildNodes().Count); }
public virtual void ParseStreamWithProps() { INode actual = SvgConverter.Parse(@is, new DummySvgConverterProperties()); NUnit.Framework.Assert.AreEqual(1, actual.ChildNodes().Count); JsoupElementNode node = (JsoupElementNode)actual.ChildNodes()[0]; NUnit.Framework.Assert.AreEqual("svg", node.Name()); NUnit.Framework.Assert.AreEqual(0, node.ChildNodes().Count); }
public virtual void ParseString() { INode actual = SvgConverter.Parse(content); NUnit.Framework.Assert.AreEqual(1, actual.ChildNodes().Count); JsoupElementNode node = (JsoupElementNode)actual.ChildNodes()[0]; NUnit.Framework.Assert.AreEqual("svg", node.Name()); NUnit.Framework.Assert.AreEqual(0, node.ChildNodes().Count); }
public virtual void ParseStreamWithOtherEncoding() { @is = new MemoryStream(content.GetBytes(Encoding.Unicode)); INode actual = SvgConverter.Parse(@is, new SvgConverterUnitTest.OtherCharsetDummySvgConverterProperties()); NUnit.Framework.Assert.AreEqual(1, actual.ChildNodes().Count); JsoupElementNode node = (JsoupElementNode)actual.ChildNodes()[0]; NUnit.Framework.Assert.AreEqual("svg", node.Name()); NUnit.Framework.Assert.AreEqual(0, node.ChildNodes().Count); }
public virtual void InheritedDefaultStyleTest() { ICssResolver styleResolver = new SvgStyleResolver(); iText.StyledXmlParser.Jsoup.Nodes.Element svg = new iText.StyledXmlParser.Jsoup.Nodes.Element(iText.StyledXmlParser.Jsoup.Parser.Tag .ValueOf("svg"), ""); iText.StyledXmlParser.Jsoup.Nodes.Element circle = new iText.StyledXmlParser.Jsoup.Nodes.Element(iText.StyledXmlParser.Jsoup.Parser.Tag .ValueOf("circle"), ""); INode svgNode = new JsoupElementNode(svg); svgNode.AddChild(new JsoupElementNode(circle)); IDictionary <String, String> resolvedStyles = styleResolver.ResolveStyles(svgNode.ChildNodes()[0], null); NUnit.Framework.Assert.AreEqual("black", resolvedStyles.Get(SvgConstants.Attributes.STROKE)); }