public void GetZoneByXY() { foreach (string[] v in ParseCsv(GetTestFilePath("resources/GetZoneByXY_v3.2.csv"))) { double x = double.Parse(v[0]); double y = double.Parse(v[1]); double lat = double.Parse(v[2]); double lon = double.Parse(v[3]); int level = int.Parse(v[4]); String code = v[5]; Zone zone = GEOHEX.GetZoneByXY(x, y, level); AssertLatitude(lat, zone.latitude); AssertLongitude(lon, zone.longitude); Assert.AreEqual(level, zone.GetLevel()); Assert.AreEqual(code, zone.code); } }
public void GetZoneByXY() { const int MaxRepeat = 100000; TimeWatch.Reset(); { double x = 5; double y = -2; int level = 0; TimeWatch.Resume(); for (int repeat = 0; repeat < MaxRepeat; repeat++) { GEOHEX.GetZoneByXY(x, y, level); } TimeWatch.Pause(MaxRepeat); } TimeWatch.OutputResult("GetZoneByXY"); }