public void FromGeometryMultiPolygonReturnsExpectedResult()
        {
            _fixture.CustomizeGeometryMultiPolygon();
            var input  = _fixture.Create <NetTopologySuite.Geometries.MultiPolygon>();
            var result = GeometryTranslator.FromGeometryMultiPolygon(input);

            Assert.Equal(
                new BoundingBox2D(
                    input.EnvelopeInternal.MinX,
                    input.EnvelopeInternal.MinY,
                    input.EnvelopeInternal.MaxX,
                    input.EnvelopeInternal.MaxY
                    ), result.BoundingBox);
            Assert.Equal(input.Geometries.Cast <NetTopologySuite.Geometries.Polygon>().Sum(polygon => polygon.Holes.Length + 1),
                         result.NumberOfParts);
            Assert.Equal(input.Geometries.Cast <NetTopologySuite.Geometries.Polygon>().Sum(polygon => polygon.Shell.NumPoints + polygon.Holes.Sum(hole => hole.NumPoints)),
                         result.NumberOfPoints);
            var linearRings = input.Geometries.Cast <NetTopologySuite.Geometries.Polygon>().SelectMany(polygon => new [] { polygon.Shell }.Concat(polygon.Holes));
            var offset      = 0;

            Assert.Equal(
                linearRings.Select(ring =>
            {
                var part = offset;
                offset  += ring.NumPoints;
                return(part);
            }).ToArray(),
                result.Parts);
            Assert.Equal(
                linearRings.SelectMany(ring => Enumerable.Range(0, ring.NumPoints).Select(index => new Point(ring.GetPointN(index).X, ring.GetPointN(index).Y))).ToArray(),
                result.Points);
        }
 public void FromGeometryMultiPolygonCanNotBeNull()
 {
     Assert.Throws <ArgumentNullException>(
         () => GeometryTranslator.FromGeometryMultiPolygon(null));
 }