| 22 | double const kEps = 1e-10; |
| 23 | |
| 24 | UNIT_TEST(MapApiSmoke) |
| 25 | { |
| 26 | string urlString = |
| 27 | "mapswithme://" |
| 28 | "map?ll=38.970559,-9.419289&ignoreThisParam=Yes&z=17&n=Point%20Name&s=black&backurl=https%3A%2F%2Fcomaps.app"; |
| 29 | TEST(url::Url(urlString).IsValid(), ()); |
| 30 | |
| 31 | ParsedMapApi test(urlString); |
| 32 | TEST_EQUAL(test.GetRequestType(), UrlType::Map, ()); |
| 33 | TEST_EQUAL(test.GetMapPoints().size(), 1, ()); |
| 34 | MapPoint const & p0 = test.GetMapPoints()[0]; |
| 35 | TEST_ALMOST_EQUAL_ABS(p0.m_lat, 38.970559, kEps, ()); |
| 36 | TEST_ALMOST_EQUAL_ABS(p0.m_lon, -9.419289, kEps, ()); |
| 37 | TEST_EQUAL(p0.m_name, "Point Name", ()); |
| 38 | TEST_EQUAL(p0.m_id, "", ()); |
| 39 | TEST_EQUAL(p0.m_style, "black", ()); |
| 40 | TEST_ALMOST_EQUAL_ABS(test.GetZoomLevel(), 17.0, kEps, ()); |
| 41 | TEST_EQUAL(test.GetGlobalBackUrl(), "https://comaps.app", ()); |
| 42 | } |
| 43 | |
| 44 | UNIT_TEST(RouteApiSmoke) |
| 45 | { |
no test coverage detected