Пример #1
0
 // Returns if the event is within an area
 private static bool EventDistance(double lat, double lon, double[] cords)
 {
     return(CalculateDistance.Calculate(new Location
     {
         Latitude = lat,
         Longitude = lon
     }, new Location
     {
         Latitude = cords[0],
         Longitude = cords[1]
     }) < cords[2]);
 }
Пример #2
0
        public void TestCalculateDistanceMethodWithExpectation()
        {
            CalculateDistance c = new CalculateDistance();

            Assert.IsTrue(Math.Abs(c.Calculate(52.986375, -6.043701, 53.3381985, -6.2592576) - 41.62) < 0.5);
        }
Пример #3
0
        public void TestCalculateDistanceMethodWithSameTwoLocations()
        {
            CalculateDistance c = new CalculateDistance();

            Assert.IsTrue(c.Calculate(53.3381985, -6.2592576, 53.3381985, -6.2592576) == 0);
        }