public void JoinsPolygonWithMultipleHoles()
        {
            Rectangular[] positions = new[]
                                          {
                                              new Rectangular(-122.0, 37.0),
                                              new Rectangular(-121.9, 37.0),
                                              new Rectangular(-121.9, 37.1),
                                              new Rectangular(-122.0, 37.1),
                                              new Rectangular(-122.0, 37.0),
                                              new Rectangular(-121.99, 37.01),
                                              new Rectangular(-121.99, 37.04),
                                              new Rectangular(-121.96, 37.04),
                                              new Rectangular(-121.96, 37.01),
                                              new Rectangular(-121.99, 37.01),
                                              new Rectangular(-121.94, 37.06),
                                              new Rectangular(-121.94, 37.09),
                                              new Rectangular(-121.91, 37.09),
                                              new Rectangular(-121.91, 37.06),
                                              new Rectangular(-121.94, 37.06),
                                              new Rectangular(-121.99, 37.06),
                                              new Rectangular(-121.99, 37.09),
                                              new Rectangular(-121.96, 37.09),
                                              new Rectangular(-121.96, 37.06),
                                              new Rectangular(-121.99, 37.06),
                                              new Rectangular(-121.94, 37.01),
                                              new Rectangular(-121.94, 37.04),
                                              new Rectangular(-121.91, 37.04),
                                              new Rectangular(-121.91, 37.01),
                                              new Rectangular(-121.94, 37.01)
                                          };
            CartographicExtent extent = new CartographicExtent(0.0, 0.0, 10.0, 10.0);
            int[] parts = new[] { 0, 5, 10, 15, 20 };

            Polygon polygon = new Polygon(new PolygonShape(0, m_metadata, extent, parts, positions), m_document, Color.Blue);
            polygon.Write();
            string result = m_stringWriter.ToString();
            Regex polygonPattern = new Regex(m_polygonPattern);
            Assert.AreEqual(1, polygonPattern.Matches(result).Count);
        }
        public void JoinsPolygonWithMultipleOuterRings()
        {
            Rectangular[] positions = new[]
                                          {
                                              new Rectangular(0.0, 5.0),
                                              new Rectangular(5.0, 10.0),
                                              new Rectangular(10.0, 5.0),
                                              new Rectangular(5.0, 0.0),
                                              new Rectangular(0.0, 5.0),
                                              new Rectangular(2.0, 5.0),
                                              new Rectangular(5.0, 2.0),
                                              new Rectangular(8.0, 5.0),
                                              new Rectangular(5.0, 8.0),
                                              new Rectangular(2.0, 5.0),
                                              new Rectangular(20.0, 5.0),
                                              new Rectangular(25.0, 10.0),
                                              new Rectangular(30.0, 5.0),
                                              new Rectangular(25.0, 0.0),
                                              new Rectangular(20.0, 5.0),
                                              new Rectangular(22.0, 5.0),
                                              new Rectangular(25.0, 2.0),
                                              new Rectangular(28.0, 5.0),
                                              new Rectangular(25.0, 8.0),
                                              new Rectangular(22.0, 5.0)
                                          };
            CartographicExtent extent = new CartographicExtent(0.0, 0.0, 30.0, 10.0);
            int[] parts = new[] { 0, 5, 10, 15 };

            Polygon polygon = new Polygon(new PolygonShape(0, m_metadata, extent, parts, positions), m_document, Color.Blue);
            polygon.Write();
            string result = m_stringWriter.ToString();
            Regex polygonPattern = new Regex(m_polygonPattern);
            Assert.AreEqual(2, polygonPattern.Matches(result).Count);
        }
        public void TestPolygonZValues()
        {
            Rectangular[] positions = new[]
                                          {
                                              new Rectangular(0.0, 5.0),
                                              new Rectangular(5.0, 10.0),
                                              new Rectangular(10.0, 5.0),
                                              new Rectangular(5.0, 0.0),
                                              new Rectangular(0.0, 5.0),
                                              new Rectangular(2.0, 5.0),
                                              new Rectangular(5.0, 2.0),
                                              new Rectangular(8.0, 5.0),
                                              new Rectangular(5.0, 8.0),
                                              new Rectangular(2.0, 5.0)
                                          };

            double[] zValues = new[]
                                   {
                                       1.0, 2.0, 3.0, 4.0, 1.0,
                                       5.0, 6.0, 7.0, 8.0, 5.0
                                   };

            CartographicExtent extent = new CartographicExtent(0.0, 0.0, 10.0, 10.0);
            int[] parts = new[] { 0, 5 };
            double[] measures = new[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };

            PolygonZShape polygonZShape = new PolygonZShape(0, m_metadata, extent, parts, positions, 1.0, 8.0, zValues, 0.0, 0.0, measures);
            Polygon polygon = new Polygon(polygonZShape, m_document, Color.Blue);
            polygon.Write();
            string result = m_stringWriter.ToString();
            Assert.IsTrue(Regex.IsMatch(result, m_polygonPattern));
        }