Ejemplo n.º 1
0
        public void CompareSvgImageWithReference(ImageTestDataSource.TestData testData)
        {
            // W3C Test Suites use external references to local fonts
            SvgDocument.ResolveExternalXmlEntites = ExternalType.Local;
            SvgDocument.ResolveExternalElements   = ExternalType.Local;
            SvgDocument.ResolveExternalImages     = ExternalType.Local;

            var basePath = testData.BasePath;

            while (!basePath.ToLower().EndsWith("svg"))
            {
                basePath = Path.GetDirectoryName(basePath);
            }
            basePath = Path.Combine(Path.Combine(basePath, "Tests"), "W3CTestSuite");
            var  svgBasePath  = Path.Combine(basePath, "svg");
            var  baseName     = testData.BaseName;
            bool testSaveLoad = !baseName.StartsWith("#");

            if (!testSaveLoad)
            {
                baseName = baseName.Substring(1);
            }
            var svgPath = Path.Combine(Path.Combine(basePath, "svg"), baseName + ".svg");
            var pngPath = Path.Combine(Path.Combine(basePath, "png"), baseName + ".png");

            CompareSvgImageWithReferenceImpl(baseName, svgPath, pngPath, testSaveLoad);
        }
Ejemplo n.º 2
0
        public void CompareSvgImageWithReference(ImageTestDataSource.TestData testData)
        {
            string basePath     = testData.BasePath;
            string baseName     = testData.BaseName;
            bool   testSaveLoad = !baseName.StartsWith("#");

            if (!testSaveLoad)
            {
                baseName = baseName.Substring(1);
            }
            var svgPath = Path.Combine(basePath, "svg", baseName + ".svg");
            var pngPath = Path.Combine(basePath, "png", baseName + ".png");

            CompareSvgImageWithReferenceImpl(baseName, svgPath, pngPath, testSaveLoad);
        }
Ejemplo n.º 3
0
        public void CompareSvgImageWithReference(ImageTestDataSource.TestData testData)
        {
            var basePath = testData.BasePath;

            while (!basePath.ToLower().EndsWith("svg"))
            {
                basePath = Path.GetDirectoryName(basePath);
            }
            basePath = Path.Combine(Path.Combine(basePath, "Tests"), "W3CTestSuite");
            var  svgBasePath  = Path.Combine(basePath, "svg");
            var  baseName     = testData.BaseName;
            bool testSaveLoad = !baseName.StartsWith("#");

            if (!testSaveLoad)
            {
                baseName = baseName.Substring(1);
            }
            var svgPath = Path.Combine(Path.Combine(basePath, "svg"), baseName + ".svg");
            var pngPath = Path.Combine(Path.Combine(basePath, "png"), baseName + ".png");

            CompareSvgImageWithReferenceImpl(baseName, svgPath, pngPath, testSaveLoad);
        }