public void Test(double srcLat, double srcLng, double dstLat, double dstLng, double expectedResult) { var src = new MapPoint(srcLat, srcLng); var dst = new MapPoint(dstLat, dstLng); Assert.AreEqual(expectedResult, calculator.CalculateInKm(src, dst), expectedResult * 0.01); }
private async Task <bool> LivesInRadiusOfCenter(double radiusInKilometers, Address address, MapPoint centerCoordinates) { MapPoint addressCoordinates = await addressToCoordinatesTranslator.Translate(address); double distance = distanceCalculator.CalculateInKm(addressCoordinates, centerCoordinates); return(distance <= radiusInKilometers); }