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); }
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); }
public void GtClosestPointGenerateTheSameResultInBothVersion() { 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 targetPoint = new Coordinate { Latitude = 3322, Longitude = 4562 }; var targetPointA = new[] { targetPoint.Latitude, targetPoint.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.GetClosestPoint(targetPointA); var rectCoordinate = hyperRectCoordinate.GetClosestPoint(targetPoint); rect[0].Should().Be(rectCoordinate.Latitude); rect[1].Should().Be(rectCoordinate.Longitude); }