public void RectWrappingAroundGlobeIsValid() { Rect rect = new Rect { xMin = -200, xMax = 200, yMin = -10, yMax = 10 }; Assert.True(GeoRectUtils.IsValidGeoRect(rect)); }
public ActionResult <IEnumerable <GeoCoordinates> > GetUsersIn(double minLongitude, double maxLongitude, double minLatitude, double maxLatitude) { Rect rect = new Rect { xMin = minLongitude, xMax = maxLongitude, yMin = minLatitude, yMax = maxLatitude }; if (!GeoRectUtils.IsValidGeoRect(rect)) { return(BadRequest()); } return(Ok(Users.GetActiveUsersIn(rect.Intersects).Select((user) => user.LastKnownLocation))); }
public void RectCrossingPolesNotValid() { Rect rectCrossingNorth = new Rect { xMin = -10, xMax = 10, yMin = 50, yMax = 100 }; Rect rectCrossingSouth = new Rect { xMin = -10, xMax = 10, yMin = 50, yMax = 100 }; Assert.False(GeoRectUtils.IsValidGeoRect(rectCrossingNorth)); Assert.False(GeoRectUtils.IsValidGeoRect(rectCrossingSouth)); }
public void RectIsValidTheory(Rect rect, string message) { Assert.True(GeoRectUtils.IsValidGeoRect(rect), message); }