public virtual void TestAddDoubleArgsOperator()
        {
            PathSvgNodeRenderer path = new PathSvgNodeRenderer();
            String instructions      = "M 500 500 S 200 100 100 200 300 300 400 400";

            path.SetAttribute(SvgConstants.Attributes.D, instructions);
            NUnit.Framework.Assert.AreEqual(3, path.GetShapes().Count);
            NUnit.Framework.Assert.IsTrue(((IList <IPathShape>)path.GetShapes())[2] is SmoothSCurveTo);
        }
        public virtual void TestAddMultipleOddArgsOperatorThenOtherStuff()
        {
            PathSvgNodeRenderer path = new PathSvgNodeRenderer();
            String instructions      = "M 500 500 200 200 300 z";

            path.SetAttribute(SvgConstants.Attributes.D, instructions);
            NUnit.Framework.Assert.AreEqual(3, path.GetShapes().Count);
            NUnit.Framework.Assert.IsTrue(((IList <IPathShape>)path.GetShapes())[2] is ClosePath);
        }
        public virtual void TestAddMultipleOddArgsOperator()
        {
            PathSvgNodeRenderer path = new PathSvgNodeRenderer();
            String instructions      = "L 500 500 200 200 300";

            path.SetAttribute(SvgConstants.Attributes.D, instructions);
            NUnit.Framework.Assert.AreEqual(2, path.GetShapes().Count);
        }
        public virtual void TestMoveOddArgsOperator()
        {
            PathSvgNodeRenderer path = new PathSvgNodeRenderer();
            String instructions      = "M 500";

            path.SetAttribute(SvgConstants.Attributes.D, instructions);
            NUnit.Framework.Assert.IsTrue(path.GetShapes().IsEmpty());
        }
        public virtual void TestAbsoluteArcOperatorCoordinates()
        {
            PathSvgNodeRenderer path = new PathSvgNodeRenderer();
            String instructions      = "M 200,300 A 10 10 0 0 0 210 310";

            path.SetAttribute(SvgConstants.Attributes.D, instructions);
            IPathShape arc = ((IList <IPathShape>)path.GetShapes())[1];
            Point      end = arc.GetEndingPoint();

            NUnit.Framework.Assert.AreEqual(new Point(210, 310), end);
        }
 public virtual void TestClosePathNoPrecedingPathsOperator()
 {
     NUnit.Framework.Assert.That(() => {
         PathSvgNodeRenderer path = new PathSvgNodeRenderer();
         String instructions      = "z";
         path.SetAttribute(SvgConstants.Attributes.D, instructions);
         NUnit.Framework.Assert.IsTrue(path.GetShapes().IsEmpty());
     }
                                 , NUnit.Framework.Throws.InstanceOf <SvgProcessingException>())
     ;
 }
 public virtual void SmoothCurveAsFirstShapeTest2()
 {
     NUnit.Framework.Assert.That(() => {
         String instructions      = "T 100,200";
         PathSvgNodeRenderer path = new PathSvgNodeRenderer();
         path.SetAttribute(SvgConstants.Attributes.D, instructions);
         path.GetShapes();
     }
                                 , NUnit.Framework.Throws.InstanceOf <SvgProcessingException>().With.Message.EqualTo(SvgExceptionMessageConstant.INVALID_SMOOTH_CURVE_USE))
     ;
 }
        public virtual void TestRelativeArcOperatorShapes()
        {
            PathSvgNodeRenderer path = new PathSvgNodeRenderer();
            String instructions      = "M 200,300 a 10 10 0 0 0 10 10";

            path.SetAttribute(SvgConstants.Attributes.D, instructions);
            IList <IPathShape> segments = (IList <IPathShape>)path.GetShapes();

            NUnit.Framework.Assert.AreEqual(2, segments.Count);
            NUnit.Framework.Assert.IsTrue(segments[0] is MoveTo);
            NUnit.Framework.Assert.IsTrue(segments[1] is EllipticalCurveTo);
        }