Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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");
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        public SvgPointListEnumerator(SvgPointList list) : base(list)

        {
        }