public void FromGeometryPolygonReturnsExpectedResult()
        {
            _fixture.CustomizeGeometryPolygon();
            var input  = _fixture.Create <NetTopologySuite.Geometries.Polygon>();
            var result = GeometryTranslator.FromGeometryPolygon(input);
            var rings  = new List <NetTopologySuite.Geometries.LineString>(new[] { input.ExteriorRing });

            rings.AddRange(input.InteriorRings);

            Assert.Equal(new BoundingBox2D(
                             rings.SelectMany(ring => Enumerable.Range(0, ring.NumPoints).Select(index => new Point(ring.GetPointN(index).X, ring.GetPointN(index).Y))).Min(point => point.X),
                             rings.SelectMany(ring => Enumerable.Range(0, ring.NumPoints).Select(index => new Point(ring.GetPointN(index).X, ring.GetPointN(index).Y))).Min(point => point.Y),
                             rings.SelectMany(ring => Enumerable.Range(0, ring.NumPoints).Select(index => new Point(ring.GetPointN(index).X, ring.GetPointN(index).Y))).Max(point => point.X),
                             rings.SelectMany(ring => Enumerable.Range(0, ring.NumPoints).Select(index => new Point(ring.GetPointN(index).X, ring.GetPointN(index).Y))).Max(point => point.Y)
                             ), result.BoundingBox);
            Assert.Equal(rings.Count, result.NumberOfParts);
            Assert.Equal(rings.Sum(ring => ring.NumPoints), result.NumberOfPoints);
            var offset = 0;

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