コード例 #1
0
        public virtual void BasicProcessedRendererTest()
        {
            iText.StyledXmlParser.Jsoup.Nodes.Element element = new iText.StyledXmlParser.Jsoup.Nodes.Element(iText.StyledXmlParser.Jsoup.Parser.Tag
                                                                                                              .ValueOf("processable"), "");
            IElementNode     tag      = new JsoupElementNode(element);
            ISvgNodeRenderer renderer = fact.CreateSvgNodeRendererForTag(tag, null);

            NUnit.Framework.Assert.IsTrue(renderer is DummyProcessableSvgNodeRenderer);
            renderer.Draw(new SvgDrawContext(null, null));
            DummyProcessableSvgNodeRenderer processed = (DummyProcessableSvgNodeRenderer)renderer;

            NUnit.Framework.Assert.IsTrue(processed.IsProcessed());
        }
コード例 #2
0
        public virtual void NestedProcessedRendererTest()
        {
            iText.StyledXmlParser.Jsoup.Nodes.Element parentEl = new iText.StyledXmlParser.Jsoup.Nodes.Element(iText.StyledXmlParser.Jsoup.Parser.Tag
                                                                                                               .ValueOf("processable"), "");
            iText.StyledXmlParser.Jsoup.Nodes.Element childEl = new iText.StyledXmlParser.Jsoup.Nodes.Element(iText.StyledXmlParser.Jsoup.Parser.Tag
                                                                                                              .ValueOf("processable"), "");
            IElementNode     parentTag      = new JsoupElementNode(parentEl);
            IElementNode     childTag       = new JsoupElementNode(childEl);
            ISvgNodeRenderer parentRenderer = fact.CreateSvgNodeRendererForTag(parentTag, null);
            ISvgNodeRenderer childRenderer  = fact.CreateSvgNodeRendererForTag(childTag, parentRenderer);

            parentRenderer.Draw(new SvgDrawContext(null, null));
            DummyProcessableSvgNodeRenderer parentProcessed = (DummyProcessableSvgNodeRenderer)parentRenderer;

            NUnit.Framework.Assert.IsTrue(parentProcessed.IsProcessed());
            DummyProcessableSvgNodeRenderer childProcessed = (DummyProcessableSvgNodeRenderer)childRenderer;

            // child is not processed unless instructed thus in its parent
            NUnit.Framework.Assert.IsFalse(childProcessed.IsProcessed());
        }