public void ToGeometryMultiPolygonReturnsExpectedResult()
        {
            _fixture.CustomizeMultiPolygon();
            var input  = _fixture.Create <Polygon>();
            var result = GeometryTranslator.ToGeometryMultiPolygon(input);

            Assert.Equal(input.NumberOfParts, result.Geometries.Cast <NetTopologySuite.Geometries.Polygon>().Sum(polygon => polygon.Holes.Length + 1));
            Assert.Equal(input.NumberOfPoints, result.Geometries.Cast <NetTopologySuite.Geometries.Polygon>().Sum(polygon => polygon.Shell.NumPoints + polygon.Holes.Sum(hole => hole.NumPoints)));
            Assert.Equal(input.BoundingBox, new BoundingBox2D(
                             result.EnvelopeInternal.MinX,
                             result.EnvelopeInternal.MinY,
                             result.EnvelopeInternal.MaxX,
                             result.EnvelopeInternal.MaxY
                             ));
            var offset = 0;
            var parts  = new List <int>();

            foreach (var linearRing in result
                     .Geometries
                     .Cast <NetTopologySuite.Geometries.Polygon>()
                     .SelectMany(polygon => new[] { polygon.Shell }.Concat(polygon.Holes)))
            {
                parts.Add(offset);
                offset += linearRing.NumPoints;
            }
            Assert.Equal(input.Parts, parts);
            Assert.Equal(input.Points,
                         result
                         .Geometries
                         .Cast <NetTopologySuite.Geometries.Polygon>()
                         .SelectMany(polygon =>
                                     polygon
                                     .Shell
                                     .Coordinates
                                     .Concat(
                                         polygon
                                         .Holes
                                         .SelectMany(hole => hole.Coordinates))
                                     .Select(point => new Point(point.X, point.Y))
                                     ));
        }
 public void ToGeometryMultiPolygonCanNotBeNull()
 {
     Assert.Throws <ArgumentNullException>(
         () => GeometryTranslator.ToGeometryMultiPolygon(null));
 }