public void can_identify_an_impossibly_inverted_bounding_box()
        {
            var englishChannelWithNorthAndSouthInverted = new BoundingBox {
                North = 48.264071m, West = -9.793268m, South = 52.065138m, East = 1.939627m
            };

            BoundingBoxUtility.IsValid(englishChannelWithNorthAndSouthInverted).Should().BeFalse();
        }
        public void can_identify_a_blank_box()
        {
            var box = new BoundingBox {
                North = 0, South = 0, East = 0, West = 0
            };

            BoundingBoxUtility.IsBlank(box).Should().BeTrue();
        }
        public void can_identify_a_valid_bounding_box()
        {
            var englishChannel = new BoundingBox {
                North = 52.065138m, West = -9.793268m, South = 48.264071m, East = 1.939627m
            };

            BoundingBoxUtility.IsValid(englishChannel).Should().BeTrue();
        }
        public void can_identify_a_bad_bounding_box_from_real_data()
        {
            var box = new BoundingBox {
                North = 58.5076m, West = -10.6494m, South = 56.7659m, East = -14.1198m
            };

            BoundingBoxUtility.IsValid(box).Should().BeFalse();
        }
        public void can_identify_an_impossibly_sized_bounding_box()
        {
            var outsideTheWorld = new BoundingBox {
                North = 10000m, West = -9.793268m, South = 48.264071m, East = 1.939627m
            };

            BoundingBoxUtility.IsValid(outsideTheWorld).Should().BeFalse();
        }
        public void can_create_correct_wkt()
        {
            var box = new BoundingBox {
                North = 40, South = 10, East = 60, West = 20
            };
            string wkt = BoundingBoxUtility.ToWkt(box);

            wkt.Should().Be("POLYGON((20 10,60 10,60 40,20 40,20 10))");
        }
        public void should_be_correct_for_single_box()
        {
            var box = new BoundingBox {
                North = 21.9259m, West = -63.8981m, South = 17.9476m, East = -60.6832m
            };

            var min = BoundingBoxUtility.MinimumOf(new[] { box });

            min.North.Should().Be(box.North);
            min.West.Should().Be(box.West);
        }
        public void should_be_correct_for_one_box_overlapping_the_other()
        {
            var southernIrishSea = new BoundingBox {
                North = 53.65873m, West = -6.967625m, South = 51.23337m, East = -3.950034m
            };
            var englishChannel = new BoundingBox {
                North = 52.065138m, West = -9.793268m, South = 48.264071m, East = 1.939627m
            };

            var min = BoundingBoxUtility.MinimumOf(new[] { southernIrishSea, englishChannel });

            // the southern irish sea is to the north of the english channel
            // but the english channel spans further to the east and west

            min.North.Should().Be(southernIrishSea.North);
            min.South.Should().Be(englishChannel.South);
            min.East.Should().Be(englishChannel.East);
            min.West.Should().Be(englishChannel.West);
        }