Ejemplo n.º 1
0
        public void PolygonWith5CoordinatePairsIsValid()
        {
            var polygon = new Polygon("38.47,-120.14 38.34,-119.95 38.52,-119.74 38.62,-119.89 38.47,-120.14");
            var polygonMinCoordinatesValidator = new PolygonMinCoordinatesValidator(polygon);

            Assert.True(polygonMinCoordinatesValidator.IsValid);
        }
Ejemplo n.º 2
0
        public void PolygonWith3CoordinatePairsIsInvalid()
        {
            var polygon = new Polygon("38.47,-120.14 38.47,-120.14");
            var polygonMinCoordinatesValidator = new PolygonMinCoordinatesValidator(polygon);

            Assert.False(polygonMinCoordinatesValidator.IsValid);

            var minCoordinatesErrors = from error in polygonMinCoordinatesValidator.Errors
                                       where error.GetType() == typeof(PolygonMinCoordinatesError)
                                       select error;

            Assert.NotEmpty(minCoordinatesErrors);
        }