public void TestFromStringMixed() { SvgPointList svgPointList = (SvgPointList)list; ISvgPoint p1, p2, p3; svgPointList.FromString("1 2 3,4 ,5 , 6"); p1 = svgPointList.GetItem(0); p2 = svgPointList.GetItem(1); p3 = svgPointList.GetItem(2); Assert.AreEqual(1, p1.X); Assert.AreEqual(2, p1.Y); Assert.AreEqual(3, p2.X); Assert.AreEqual(4, p2.Y); Assert.AreEqual(5, p3.X); Assert.AreEqual(6, p3.Y); }
public void TestFromStringCommaDelimited() { SvgPointList svgPointList = (SvgPointList)list; ISvgPoint p1, p2, p3; svgPointList.FromString("1,2, 3 ,4 , 5,6"); p1 = svgPointList.GetItem(0); p2 = svgPointList.GetItem(1); p3 = svgPointList.GetItem(2); Assert.AreEqual(1, p1.X); Assert.AreEqual(2, p1.Y); Assert.AreEqual(3, p2.X); Assert.AreEqual(4, p2.Y); Assert.AreEqual(5, p3.X); Assert.AreEqual(6, p3.Y); bool except = false; try { svgPointList.FromString("1,2, 3 , , 5,6"); } catch (SvgException) { except = true; } Assert.IsTrue(except, "Double comma should give an invalid value SVG exception"); }
public void TestFromStringOneValue() { SvgPointList svgPointList = (SvgPointList)list; ISvgPoint p1; svgPointList.FromString("1 2"); p1 = svgPointList.GetItem(0); Assert.AreEqual(1, p1.X); Assert.AreEqual(2, p1.Y); }
public void TestFromStringTrailingWhitespace() { SvgPointList svgPointList = (SvgPointList)list; ISvgPoint p1, p2; svgPointList.FromString("1 2 3 4 "); p1 = svgPointList.GetItem(0); p2 = svgPointList.GetItem(1); Assert.AreEqual(1, p1.X); Assert.AreEqual(2, p1.Y); Assert.AreEqual(3, p2.X); Assert.AreEqual(4, p2.Y); }