Beispiel #1
0
        public void CircleWithValidCoordinatesIsValid()
        {
            var validCoordinate = new Coordinate(50, 50);
            var validCircle = new Circle(validCoordinate, 55);

            var circleValidator = new CircleValidator(validCircle);
            Assert.True(circleValidator.IsValid);
        }
        public void AreaWithCircleWithInvalidCoordinatesIsInvalid()
        {
            var validCoordinate = new Coordinate(50, 50);
            var validCircle = new Circle(validCoordinate, 20);
            var area = new Area();
            area.Circles.Add(validCircle);

            var circlesValidator = new CirclesValidator(area);
            Assert.True(circlesValidator.IsValid);
        }
Beispiel #3
0
        public void CircleWithInvalidCoordinatesIsInvalid()
        {
            var invalidCoordinate = new Coordinate(400, 400);
            var invalidCircle = new Circle(invalidCoordinate, 14);

            var circleValidator = new CircleValidator(invalidCircle);
            Assert.False(circleValidator.IsValid);

            var errors = from error in circleValidator.Errors
                         where error.GetType() == typeof(WGS84Error)
                         select error;
            Assert.NotEmpty(errors);
        }