Esempio n. 1
0
        public void ChangeStyleAndRender()
        {
            string svgPath = Path.Combine(dirPath, "rectangleFillStroke.svg");
            doc.Load(svgPath);

            CompareUtil util = new CompareUtil();
            Assert.IsTrue(util.CompareImages(renderer.Render(doc), Path.Combine(dirPath, "rectangleFillStroke.svg.png")));

            SvgRectElement elm = doc.GetElementById("theRect") as SvgRectElement;
            elm.Style.SetProperty("fill", "yellow", "");

            Assert.IsTrue(util.CompareImages(renderer.Render(doc), Path.Combine(dirPath, "changeStyle.png")));
        }
Esempio n. 2
0
        private bool CompareImages(string svgFile)
        {
            svgFile = Path.Combine(baseDir, svgFile);
            CompareUtil util = new CompareUtil();

            SvgDocument doc = new SvgDocument(window);
            doc.Load(svgFile);

            return util.CompareImages(renderer.Render(doc), svgFile + ".png");
        }