Exemplo n.º 1
0
        public void GivenSimpleSvg_ShouldOptimizeUsingDefaults()
        {
            var input        = "<!-- Generator: Adobe Illustrator 15.0.0, SVG Export --><svg  xmlns=\"http://www.w3.org/2000/svg\" \n viewBox=\"0 0 12 16\">\n<path nothing=\"\" d=\"M 10,30 A 20,20 0,0,1 50,30 A 20,20 0,0,1 90,30 Q 90,60 50,90 Q 10,60 10,30 z\">\n</path>\n   </svg>    \n\n  ";
            var svgOptimizer = new SvgOptimizer();
            var output       = svgOptimizer.Optimize(input);

            Assert.AreEqual("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 16\"><path d=\"M 10,30 A 20,20 0,0,1 50,30 A 20,20 0,0,1 90,30 Q 90,60 50,90 Q 10,60 10,30 z\"></path></svg>", output);
        }
Exemplo n.º 2
0
        public void FileFixtures()
        {
            var svgOptimizer = new SvgOptimizer();

            foreach (var file in Directory.GetFiles("Fixtures/Original"))
            {
                Assert.AreEqual(File.ReadAllText(file.Replace("Original", "Optimized")).Trim(), svgOptimizer.Optimize(File.ReadAllText(file)));
            }
        }