public void Main()
        {
            string    xmlPath = TestConstants.XML_OUTPUT_FULL + TestConstants.RECTANGLE_XML;
            Rectangle r1      = new Rectangle(new Point(50, 100), new Point(100, 150));

            r1.save(xmlPath);
            Rectangle r2 = Shape.load(xmlPath, typeof(Rectangle)) as Rectangle;

            Assert.AreEqual(r1.point1.x, r2.point1.x);
            Assert.AreEqual(r1.point2.x, r2.point2.x);
            Assert.AreEqual(r1.point2.y, r2.point2.y);
            Assert.AreEqual(r1.point2.y, r2.point2.y);

            string          pngPath  = TestConstants.PNG_OUTPUT_FULL + TestConstants.RECTANGLE_PNG;
            GraphicsWrapper gw       = new GraphicsWrapper();
            Graphics        graphics = gw.graphics;

            r1.render(graphics);
            r1.translate(100, 100);
            r1.scale(2);
            Assert.AreEqual(r1.point1.x, 125);
            Assert.AreEqual(r1.point1.y, 175);
            Assert.AreEqual(r1.point2.x, 225);
            Assert.AreEqual(r1.point2.y, 275);
            Assert.AreEqual(r1.getArea(), 10000);
            r1.render(graphics);
            gw.saveToFile(pngPath);
        }
        public void Main()
        {
            string solDir = TestUtils.getSolutionDirectory();

            string    xmlPath = TestConstants.XML_OUTPUT_FULL + TestConstants.PICTURE_XML;
            Rectangle r1      = new Rectangle(new Point(100, 50), new Point(300, 250));
            Picture   p1      = new Picture(r1, solDir + TestConstants.IMAGE_DIR + Constants.defaultImages[0]);

            p1.save(xmlPath);
            Picture p2 = Shape.load(xmlPath, typeof(Picture)) as Picture;

            Assert.AreEqual(p1.intrinsicState.src, p2.intrinsicState.src);
            Assert.AreEqual(p1.point1.x, p2.point1.x);
            Assert.AreEqual(p1.point1.y, p2.point1.y);
            Assert.AreEqual(p1.point2.x, p2.point2.x);
            Assert.AreEqual(p1.point2.y, p2.point2.y);

            string          pngPath  = TestConstants.PNG_OUTPUT_FULL + TestConstants.PICTURE_PNG;
            GraphicsWrapper gw       = new GraphicsWrapper();
            Graphics        graphics = gw.graphics;

            p1.render(graphics);
            gw.saveToFile(pngPath);
        }