public void ValidateLongitude_Geography() { GeographyPipeline v = new SpatialValidatorImplementation(); v.SetCoordinateSystem(NonDefaultGeographicCoords); v.BeginGeography(SpatialType.Point); var ex = SpatialTestUtils.RunCatching<FormatException>(() => v.BeginFigure(new GeographyPosition(0, -15070, 0, 0))); Assert.NotNull(ex); Assert.Equal(Strings.Validator_InvalidLongitudeCoordinate(-15070), ex.Message); v.Reset(); v.SetCoordinateSystem(NonDefaultGeographicCoords); v.BeginGeography(SpatialType.Point); ex = SpatialTestUtils.RunCatching<FormatException>(() => v.BeginFigure(new GeographyPosition(0, 15070, 0, 0))); Assert.NotNull(ex); Assert.Equal(Strings.Validator_InvalidLongitudeCoordinate(15070), ex.Message); }
public void ValidatePolygonRing_LessThanFour_Geography() { GeographyPipeline v = new SpatialValidatorImplementation(); v.SetCoordinateSystem(NonDefaultGeographicCoords); v.BeginGeography(SpatialType.Polygon); v.BeginFigure(new GeographyPosition(10, 20, 30, 40)); v.LineTo(new GeographyPosition(20, 30, 40, 50)); v.LineTo(new GeographyPosition(20, 30, 40, 50)); var ex = SpatialTestUtils.RunCatching<FormatException>(v.EndFigure); Assert.NotNull(ex); Assert.Equal(Strings.Validator_InvalidPolygonPoints, ex.Message); }
public void ValidatePolygonRing() { GeometryPipeline v = new SpatialValidatorImplementation(); v.SetCoordinateSystem(NonDefaultGeometricCoords); v.BeginGeometry(SpatialType.Polygon); v.BeginFigure(new GeometryPosition(10, 20, 30, 40)); v.LineTo(new GeometryPosition(20, 30, 40, 50)); v.LineTo(new GeometryPosition(20, 40, 40, 50)); v.LineTo(new GeometryPosition(10, 20, 30, 40)); v.EndFigure(); v.EndGeometry(); }