public void OneStrokeIsFound() { var source = System.Xml.Linq.XElement.Parse( "<svg>" + "<polygon\n points=\"1,2 3,4 5,6 \" style=\"fill:#bbbbcc;stroke:#00aaff;stroke-width:1\"/>" + "</svg>" ); var reader = new SvgReader(source); List <SvgObjectProperty> strokes = reader.ReadObjectProperties().Where(s => s.Type == SvgPropertyType.Stroke).ToList(); Assert.AreEqual(1, strokes.Count); Assert.AreEqual("stroke:#00aaff", strokes[0].Color); }
public void TwoSameColorsAreFoundOnlyOnce() { var source = System.Xml.Linq.XElement.Parse( "<svg>" + "<polygon\n points=\"1,2 3,4 5,6 \" style=\"fill:#bbbbcc;stroke:#000000;stroke-width:1\"/>" + "<polygon\n points=\"54,2 3,4 5,6 \" style=\"stroke:#000000;fill:#bbbbcc;stroke-width:1\"/>" + "</svg>" ); var reader = new SvgReader(source); List <SvgObjectProperty> fills = reader.ReadObjectProperties().Where(s => s.Type == SvgPropertyType.Fill).ToList(); Assert.AreEqual(1, fills.Count); Assert.AreEqual("fill:#bbbbcc", fills[0].Color); }