コード例 #1
0
        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);
        }