Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBuildInValidPolygonWith2InnerRings()
        public virtual void testBuildInValidPolygonWith2InnerRings()
        {
            string testfile = "invalid-polygon-2-inner-rings.wkt";

            IList <TDWay> ways     = MockingUtils.wktPolygonToWays(testfile);
            Polygon       polygon  = JTSUtils.buildPolygon(ways[0], ways.subList(1, ways.Count));
            Geometry      expected = MockingUtils.readWKTFile(testfile);

            Assert.isTrue(!polygon.Valid);
            Assert.Equals(expected, polygon);
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBuildInvalidPolygon()
        public virtual void testBuildInvalidPolygon()
        {
            string testfile = "invalid-polygon.wkt";

            IList <TDWay> ways     = MockingUtils.wktPolygonToWays(testfile);
            Polygon       polygon  = JTSUtils.buildPolygon(ways[0]);
            Geometry      expected = MockingUtils.readWKTFile(testfile);

            Assert.isTrue(!polygon.Valid);
            Assert.Equals(expected, polygon);
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBuildValidMultiLineString()
        public virtual void testBuildValidMultiLineString()
        {
            string testfile = "valid-multilinestring.wkt";

            IList <TDWay>   ways     = MockingUtils.wktMultiLineStringToWays(testfile);
            MultiLineString mls      = JTSUtils.buildMultiLineString(ways[0], ways.subList(1, ways.Count));
            Geometry        expected = MockingUtils.readWKTFile(testfile);

            Assert.isTrue(mls.Valid);
            Assert.Equals(expected, mls);
        }
Beispiel #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBuildGeometryFromInValidPolygonWithHoles()
        public virtual void testBuildGeometryFromInValidPolygonWithHoles()
        {
            string testfile     = "invalid-polygon-2-inner-rings.wkt";
            string expectedfile = "invalid-polygon-2-inner-rings-repaired.wkt";

            IList <TDWay> ways     = MockingUtils.wktPolygonToWays(testfile);
            Geometry      geometry = JTSUtils.toJtsGeometry(ways[0], ways.subList(1, ways.Count));

            Assert.isTrue(geometry is Polygon);
            Assert.isTrue(geometry.Valid);

            Geometry expected = MockingUtils.readWKTFile(expectedfile);

            Assert.Equals(expected, geometry);
        }