Example #1
0
        public void InfiniteShouldReturnTheSameResultInBothVerison()
        {
            var minPoint = new Coordinate {
                Latitude = 6544, Longitude = 5577
            };
            var maxPoint = new Coordinate {
                Latitude = 9687, Longitude = 1254
            };

            var minPointA = new[] { minPoint.Latitude, minPoint.Longitude };
            var maxPointA = new[] { maxPoint.Latitude, maxPoint.Longitude };

            var hyperRect = new HyperRect <double>();

            hyperRect.MinPoint = minPointA;
            hyperRect.MaxPoint = maxPointA;

            var hyperRectCoordinate = new HyperRectCoordinate <Coordinate>();

            hyperRectCoordinate.MinPoint = minPoint;
            hyperRectCoordinate.MaxPoint = maxPoint;

            var rect           = hyperRect.Clone();
            var rectCoordinate = hyperRectCoordinate.Clone();

            var res1 = HyperRect <double> .Infinite(2, double.MaxValue, double.MinValue);

            var res2 = HyperRectCoordinate <Coordinate> .Infinite(2, double.MaxValue, double.MinValue);

            res1.MaxPoint[0].Should().Be(res2.MaxPoint.Latitude);
            res1.MaxPoint[1].Should().Be(res2.MaxPoint.Longitude);
            res1.MinPoint[0].Should().Be(res2.MinPoint.Latitude);
            res1.MinPoint[1].Should().Be(res2.MinPoint.Longitude);
        }
Example #2
0
        public void CloneGenerateTheSameResultInBothVersion()
        {
            var minPoint = new Coordinate {
                Latitude = 6544, Longitude = 5577
            };
            var maxPoint = new Coordinate {
                Latitude = 9687, Longitude = 1254
            };

            var minPointA = new[] { minPoint.Latitude, minPoint.Longitude };
            var maxPointA = new[] { maxPoint.Latitude, maxPoint.Longitude };

            var hyperRect = new HyperRect <double>();

            hyperRect.MinPoint = minPointA;
            hyperRect.MaxPoint = maxPointA;

            var hyperRectCoordinate = new HyperRectCoordinate <Coordinate>();

            hyperRectCoordinate.MinPoint = minPoint;
            hyperRectCoordinate.MaxPoint = maxPoint;

            var rect           = hyperRect.Clone();
            var rectCoordinate = hyperRectCoordinate.Clone();

            rect.MinPoint[0].Should().Be(rectCoordinate.MinPoint.Latitude);
            rect.MinPoint[1].Should().Be(rectCoordinate.MinPoint.Longitude);

            rect.MaxPoint[0].Should().Be(rectCoordinate.MaxPoint.Latitude);
            rect.MaxPoint[1].Should().Be(rectCoordinate.MaxPoint.Longitude);
        }